Could Not Load Type

SYMPTOMS

When you browse to an .aspx page, you may receive one of the following error messages:
Could not load type 'Namespace.Global'.
-or-

Could not load type 'Namespace.PageName'.

BECAUSE

These errors occur if the .aspx page or the Global.asax page contains a reference to a code-behind module and if the application has not been built.

RESOLUTION

Use one of the following methods to build the application:
  • 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.

STATUS

This behavior is by design.
  • 0 A felhasználók hasznosnak találták ezt
Hasznosnak találta ezt a választ?

Related Articles

How to configure ASP.NET 2.0 medium trust in your testing environment/server

You may refer to the step below to set Windows Server ASP.NET medium trust level. By default...

Parser Error Message: The virtual path '/common/footer.ascx' maps to another application, which is not allowed.

Parser Error Description: An error occurred during the parsing of a resource required to service...