无法使用Asp.Net 2.0加载类型错误 [英] Could not load type error with Asp.Net 2.0

查看:77
本文介绍了无法使用Asp.Net 2.0加载类型错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用新的Visual Studio 2005构建了一个ASP站点。该站点使用了一个

简单的母版页。在我的本地机器上,一切运行都很好。

当我发布网站并将其FTP到服务器时,它不会运行。我

收到以下错误消息。


''/ test2''应用程序中的服务器错误。

---- -------------------------------------------------- --------------------------


解析器错误

描述:解析服务此请求所需的资源

时发生错误。请查看以下具体的

解析错误详细信息并适当修改源文件。


解析器错误消息:无法加载类型''MasterPage''。


来源错误:

第1行:<%@ master language =" C#" autoeventwireup =" true"

inherits =" MasterPage" %>

第2行:

第3行:< html>

源文件:/test2/MasterPage.master行:1

------------------------------------------- -------------------------------------

版本信息:Microsoft。 .NET Framework版本:2.0.50727.42;

ASP.NET版本:2.0.50727.42


有谁知道发生了什么?我很沮丧。我不知道出了什么问题,网上似乎也没有人知道。并且

是的,安装了.net 2.0,如错误消息所示。

I built an ASP site using the new Visual Studio 2005. The site uses a
simple master page. On my local machine everything runs just fine.
When I publish the site and FTP it to the server, it doesn''t run. I
get the following error message.

Server Error in ''/test2'' 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 ''MasterPage''.

Source Error:
Line 1: <%@ master language="C#" autoeventwireup="true"
inherits="MasterPage" %>
Line 2:
Line 3: <html>
Source File: /test2/MasterPage.master Line: 1
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET Version:2.0.50727.42

Anybody know what''s going on? I am getting pretty frustrated. I have
no idea what is wrong, and nobody on the web seems to know either. And
yes, .net 2.0 is installed, as indicated in the error message.

推荐答案

您选择与MasterPage控件名称冲突的名称,尝试

将您的MasterPage.Master重命名为其他类似PageTemplate或

之类的东西。

-

谢谢,

< Ram />

" we ********** @ gmail.com"写道:
The name you have chosen conflicts with the name of MasterPage control, try
renaming your MasterPage.Master to something else like PageTemplate or
something like that.
--
Thanks,
<Ram/>
"we**********@gmail.com" wrote:
我使用新的Visual Studio 2005构建了一个ASP站点。该站点使用了一个简单的母版页。在我的本地机器上,一切运行正常。
当我发布网站并将其FTP到服务器时,它不会运行。我收到以下错误消息。

''/ test2''应用程序中的服务器错误。
---------------- -------------------------------------------------- --------------

分析器错误
描述:解析服务此请求所需的资源时发生错误。请查看以下具体的
解析错误详细信息并适当修改源文件。

解析器错误消息:无法加载类型''MasterPage''。

来源错误:

第1行:<%@ master language =" C#" autoeventwireup =" true"
inherits =" MasterPage" %>
第2行:
第3行:< html>

源文件:/test2/MasterPage.master行:1

- -------------------------------------------------- -----------------------------
版本信息:Microsoft .NET Framework版本:2.0.50727.42;
ASP.NET版本:2.0.50727.42

任何人都知道发生了什么?我很沮丧。我不知道出了什么问题,网上似乎也没有人知道。并且
是的,安装了.net 2.0,如错误消息所示。
I built an ASP site using the new Visual Studio 2005. The site uses a
simple master page. On my local machine everything runs just fine.
When I publish the site and FTP it to the server, it doesn''t run. I
get the following error message.

Server Error in ''/test2'' 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 ''MasterPage''.

Source Error:
Line 1: <%@ master language="C#" autoeventwireup="true"
inherits="MasterPage" %>
Line 2:
Line 3: <html>
Source File: /test2/MasterPage.master Line: 1
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET Version:2.0.50727.42

Anybody know what''s going on? I am getting pretty frustrated. I have
no idea what is wrong, and nobody on the web seems to know either. And
yes, .net 2.0 is installed, as indicated in the error message.



我构建了一个全新的项目,尝试命名主文件

" Interface.master"代替。同样的问题,这是新的错误

消息。我还注意到,当我创建母版页文件时,VS2005尝试使用的

默认名称是MasterPage.master。如果

该文件名有问题,他们为什么要先将它插入那里




任意其他建议?


''/ test2''应用程序中的服务器错误。

---------------- -------------------------------------------------- --------------


解析器错误

描述:解析资源时出错

需要服务此请求。请查看以下具体的

解析错误详细信息并适当修改源文件。


解析器错误消息:无法加载类型''Interface''。


来源错误:

第1行:<%@ master language =" C#" autoeventwireup =" true"

inherits =" Interface" %>

第2行:

第3行:<!DOCTYPE html PUBLIC" - // W3C // DTD XHTML 1.1 // EN"

" http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

源文件:/test2/Interface.master专栏:1

-------------------------------------------- ------------------------------------

版本信息:Microsoft .NET框架版本:2.0.50727.42;

ASP.NET版本:2.0.50727.42

I build a whole new project and tried naming the masterfile
"Interface.master" instead. Same problem, here is the new error
message. I also noticed that when I created the master page file, the
default name that VS2005 tried to use was "MasterPage.master" If there
was something wrong with that filename, why would they plug it in there
for you at first?

Any other suggestions?

Server Error in ''/test2'' 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 ''Interface''.

Source Error:
Line 1: <%@ master language="C#" autoeventwireup="true"
inherits="Interface" %>
Line 2:
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
Source File: /test2/Interface.master Line: 1
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET Version:2.0.50727.42


您可以使用MasterPage.master ;。这个名字不是问题。


你是否,至少在你创建新的.master文件后构建母版页或重建

应用程序?


你在哪里放置MasterPage.master.cs ?

(和/或Interface.master.cs,在这种情况下......)


Juan T. Llibre

ASP.NET.FAQ: http://asp.net.do/faq/

ASPNETFAQ.COM: http://www.aspnetfaq .com /

Foros de ASP.NET en Espa?ol: http://asp.net.do/foros/

====================== ================


< we ********** @ gmail.com>在消息中写道

news:11 ********************** @ g43g2000cwa.googlegr oups.com ...
You can use "MasterPage.master". That name isn''t a problem.

Are you, at least, building the master page or rebuilding
the application after you create your new .master file ?

Where are you placing "MasterPage.master.cs" ?
( and/or "Interface.master.cs", in this case... )

Juan T. Llibre
ASP.NET.FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Espa?ol : http://asp.net.do/foros/
======================================

<we**********@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
我构建了一个全新的项目,并尝试命名主文件
Interface.master。代替。同样的问题,这是新的错误消息。我还注意到,当我创建母版页文件时,VS2005尝试使用的
默认名称是MasterPage.master。如果那个文件名有问题,为什么他们一开始就把它插在那里


任何其他的建议?

服务器''/ test2''应用程序出错。
------------------------------------ --------------------------------------------
描述:解析服务此请求所需的资源时发生错误。请查看以下具体的解析错误详细信息并适当修改源文件。

解析器错误消息:无法加载类型''Interface''。

来源错误:

第1行:<%@ master language =" C#" autoeventwireup =" true"
inherits =" Interface" %>
第2行:
第3行:<!DOCTYPE html PUBLIC" - // W3C // DTD XHTML 1.1 // EN"
" http:// www。 w3.org/TR/xhtml11/DTD/xhtml11.dtd">

源文件:/test2/Interface.master行:1

------ -------------------------------------------------- ------------------------
版本信息:Microsoft .NET Framework版本:2.0.50727.42;
ASP.NET版本: 2.0.50727.42
I build a whole new project and tried naming the masterfile
"Interface.master" instead. Same problem, here is the new error
message. I also noticed that when I created the master page file, the
default name that VS2005 tried to use was "MasterPage.master" If there
was something wrong with that filename, why would they plug it in there
for you at first?

Any other suggestions?

Server Error in ''/test2'' 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 ''Interface''.

Source Error:
Line 1: <%@ master language="C#" autoeventwireup="true"
inherits="Interface" %>
Line 2:
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
Source File: /test2/Interface.master Line: 1
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET Version:2.0.50727.42



这篇关于无法使用Asp.Net 2.0加载类型错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆