Isabella
---- I fell upon the thorn of life, I bleed.

 

Reference from http://support.microsoft.com/kb/306155

当浏览C# .NET aspx 页时出现"Could not load type" 错误

症状:

当浏览一个.aspx页,可能会收到以下错误信息:

Could not load type 'Namespace.Global'.

--

Could not load type 'Namespace.PageName'.  

原因:

这些错是因为aspx 页或Global.asax 包含一些后台代码模块的引用但应用程序却没有编译。

解决方案:

用以下方法编译应用程序:

Use the C# command line compiler (CSC.exe) to run the following command:

csc /t:library /r:System.web.dll /out:mydll.dll myfile.cs

In Microsoft Visual Studio .NET, click Build on the Build menu.

NOTE: Microsoft Visual Basic .NET background compiles the project as soon as it is created. Because Visual C# .NET projects only background parse, you must explicitly build the application.  

 


APPLIES TO

Microsoft ASP.NET 1.0

Microsoft Visual C# .NET 2002 Standard Edition

 

 

posted on 2007-03-02 09:58  李昀璟  阅读(859)  评论(1)    收藏  举报