2009-11-10 64 views
4

一切正常时找到当地,但是当我公布我的asp.net应用程序到远程服务器,我收到以下错误:母版页越来越未能加载类型错误发布

Server Error in '/' Application. 

Parser Error 

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

    Parser Error Message: Could not load type 'JournalPages.MasterMain'. 

    Source Error: 

    Line 1: <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Main.master.cs" Inherits="JournalPages.MasterMain" %> 
    Line 2: 
    Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

Source File: /journalpages/Main.Master Line: 1 

这发生在任何网页上有一个母版页。我使用Reflector查看bin目录中的程序集,并且类型都在那里。有任何想法吗??

+0

是.net 2.0确定安装在服务器上? – Paul 2009-11-10 17:47:31

回答

3

好吧,事实证明,他们还没有在IIS中设置站点文件夹作为应用程序。一旦他们都做得很好。

+0

您究竟如何将其更改为应用程序而不是网站?在Web应用程序项目中,我使用II6完全相同的问题。 – mikeschuld 2010-03-30 18:12:47

+0

通过编辑Web部署项目中的解决了我的问题。它需要是一个相对路径,不是指向本地机器的路径。 – mikeschuld 2010-03-30 19:45:32

+0

在IIS中,他们只需设置ApplicationName。 – Ryan 2010-10-19 17:39:16

0

听起来像我在IIS中的网站设置为使用.NET 1.1。转到IIS中网站的属性页面,然后单击ASP.NET选项卡。我敢打赌,该版本说1.1.4322

1

我有同样的问题。只需将“JournalPages.MasterMain.ca”和“JournalPages.MasterMain.designer.cs”复制到您的虚拟文件夹中,即可解决问题。

+0

虚拟文件夹? – 2013-04-23 13:05:29

2

如果您正在生成Web设置并尝试通过安装进行测试,请确保输出文件(如Ui dll及其支持的dll)在BIN文件夹中可用。

1

你只需要通过.\

例如交换~/

wrong :MasterPageFile="~/CMaster.master" 
right :MasterPageFile=".\CMaster.master" 
+0

我误读了这个,并将我的MasterPage.Master从 'CodeBehind =“〜\ MasterPage.Master.vb”' 改为 'CodeBehind =“。\ MasterPage.Master.vb”' ,它适用于我的情况。我不必在任何其他页面上更改MasterPageFile。奇怪的。 – jyoung 2016-03-29 15:37:02

+0

使用母版页的某些页面可以正常工作,而无需进一步更改,但其他页面现在失败。我认为这是一个编译器错误。 – jyoung 2016-03-29 15:42:47

0

我有同样的问题。只能找到比较我用早期版本的VS构建的旧站点.... VS现在使用“CodeBehind”代替“CodeFile”...所以我只是用“CodeFile”代替所有的“CodeBehind”和噗它的工作

(这是GoDaddy的)

希望这有助于

0

在我的情况下发生的问题,当我改名为母版。解决我必须纠正在主页上的继承

Inherits="Namespace.MasterpaseClassName"