Introduction You may receive the following error when browsing an asp.net application
"Parser Error Message: Could not load type 'WebApplication1.Global'."
Source Error:
Line 1: <%@ Application Codebehind="Global.asax.cs" Inherits="'WebApplication1.Global'" %>
Why this error occurs? This error occurs when you create a new web application in asp.net using visual studio.net and without compiling the application, you try to browse a page in the application.
This occurs because of the Application DLL not having been formed.
Asp.net will look in the Global Assembly Cache, and then in the application's local bin directory. If it can't find the class with the name you specified then it won't load. When you do a codebehind file in Visual studio, you are writing a base class for your aspx file to inherit from - the HTML template you write in the aspx is inlined into the dynamically generated subclass's Render method.
Even if you don't put any code in your page, you still need to compile it as long as you put the Inherts Webappname.Global in your Page directive.
Resolution To resolve this, Built the application using Ctrl + Shift + B or use F5 to build the application and then try to browse the application. The error will be resolved.
Applies To This is applicable to .NET 1.0, 1.1 versions - Visual Studio.NET
Summary This article discussed on solving the error "Parser Error Message: Could not load type 'WebApplication1.Global'." that occurs when working with ASP.NET
|
No responses found. Be the first to respond and make money from revenue sharing program.
|