An ASP.NET Blog
I work for Microsoft and help people and businesses make better use of technolgy to realize their full potential. The opinions mentioned herein are solely mine and do not reflect those of my employer.

You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

Monday, April 25, 2005 7:49 AM
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'" %>

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.

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.

This is applicable to .NET 1.0, 1.1 versions - Visual Studio.NET



Feedback

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

I am getting this error and I HAVE built the application. The problem is still occuring. It is very frustrating. 7/26/2005 4:36 PM | Tom

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

Harish: Thanks for finally nailing down for me what was causing this insidious, inexplicable error. I'd read other solutions about namespaces, but those didn't help me.
In my case, I was compiling the application each time, but the offending code was in a second application (within the main one) which actually wasn't getting compiled. Once I deleted the .dll from the /bin of the main project and recompiled both projects, it worked. 8/5/2005 11:44 AM | BlueSpider

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

HI,
I am getting the same parser error. My application is different. I have to call an asp.net application from a asp application.so this asp.net is a part of asp application and is access from a menu in asp. so this .net application cannot be configured with virtual directiry. when i access a aspx page from asp i get this erro. what should I do to resolve this? 11/2/2005 12:27 AM | Deepa

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

I tried every possible solutions to fix this problem. I removed all the projects and solution. Built new solution and project, and still getting this problem! 11/9/2005 11:57 AM | Eduard

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

when i am running in my system locally it works . But after uploading in main server . When i run on the internet it is not working . what is the solution 11/10/2005 2:32 AM | raghu

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

raghu i get the same problem as you, have u solved this yet? 11/24/2005 8:42 AM | chris

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

I'm also getting this same problem. I've done extensive research to try and solve this without success! - if I take out the "Inherits" the page displays OK, but none of the interactive form components will function (i.e. buttons), because the ASPX page needs the "Inherits" reference to the code behind... 11/27/2005 8:43 AM | K C

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

I am getting similar error.
Project is working fine at local server (localhost)
The same code if I post to main server (production), I am getting
this error.
I re installed vs 2003 and recompile everything.
I think this is a severe bug in vs 2003.
Any chance please let me also know to fix.
12/4/2005 3:42 PM | Bapuji

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

If it runs successfully locally, but not on the server; verify that any dll files located in your \bin subdirectory also exist on the server's \bin subdirectory and that they have the same dates. 1/4/2006 1:21 PM | Wiseguy

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

I've had the same issue...try checking the version of .net being used by IIS on your website. if you're developing in .NET 2.0 and it's set to 1.1 you'll get this message 1/16/2006 10:18 PM | spamcannon

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

I think I have found one of the possible solution, click "project name"."properties", then name "Root namespace" to the web application name, such as "WebApplication1", then recompile dll 1/27/2006 12:44 AM | superdigua

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

Great i had days with the problema, and this page give me solution.

Thanks

2/13/2006 7:34 PM | Carlos gomez

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

Thanks superdigua, problem solved. I wish I'd seen this a couple of weeks ago! 2/28/2006 11:02 AM | jdenyer

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

I`m getting the same error. Could anyone suggest me a solution?
I tried with the solution given here, but even then i`m getting the same problem.thanks..... 3/1/2006 1:12 AM | Jeeva

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

I`m getting the same error. Could anyone suggest me a solution?
I tried with the solution given here, but even then i`m getting the same problem.thanks.....
3/11/2006 12:07 PM | shikha

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

Use Computer Manager to examine the IIS settings. Look and see if the location of your files is configured as a web app or just a folder (folder icon).

If it is a folder right click on it, then next to the grayed out application name click on the create button to create a webapp.

Then click ok. Then try your app again 4/1/2006 7:52 PM | David Lundell

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

I have the solution, I have several namespaces boomtrek.canada, boomtrek.united_states.new_york, etc.

I was having a problem with boomtrek.partners and realized that in IIS I had originally added it as a web app.

My main application is running under the boomtrek namespace so it was actually looking for /boomtrek/partners/bin/ directory where there was NONE! this is because it was configured as a web app inside my primary web app folder of /boomtrek/

After going into IIS admin, right click on the website, Properties... the application was 'partners' click Remove... and it worked!

My situation was complex as it was a namespace inside a namespace problem... those out there with only one active namespace try just clicking "Remove" and then "Create" right after... now recompile your application and voila, should be showing the page! 4/8/2006 1:16 AM | James

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

I followed many of the suggestions here, but only had success after I closed VS Studio and reopend the solution and then recompiled all the projects. I don't know if this is a documented bug, but this kind of problem has occurred to me more than once, where a known solution doesn't work until I restart VS Studio. Somehow the solution/project info gets "stuck" and doesn't get reset until you restart the IDE. Very stupid. 4/20/2006 6:13 PM | Dan Bailiff

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

My solution was to delete everything in every bin folder i had .. and re-Build the solution 4/23/2006 11:11 AM | JohnG

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

The solution I found for this was to Check the ASP.NET properties in IIS. Even though they displayed the correct .net version, I changed it to a different version, clicked apply, I then changed the setting to the correct version and again clicked apply than OK to exit. I was than able to display the web page without the error message.
5/4/2006 3:35 PM | ChuckG

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

i am getting following kind of error
<%@ Application Codebehind="$FILENAME$.vb" Inherits="$INHERITS$" %>
What can i do for this
5/9/2006 2:55 AM | Swati Jain

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

Hi, i had the same problem with a W03 server linked to a NAS system.
problem has been solved with this KB:
http://support.microsoft.com/kb/320268/en-us

Hope it will help you ;) 5/18/2006 7:28 AM | Bad Project

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

check global.asax inherits namespace is the same as the application

<%@ Application Codebehind="Global.asax.vb" Inherits="YourApplicationNamespace.Global" %> 5/29/2006 10:30 PM | PinoyA

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

Here is what worked for me:

Find the project under IIS Manager, select properties and select ASP.NET. I changed Version 1.1.4 to 2.0.

Forch 6/10/2006 7:09 PM | Forch

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

Hmmm...tried all of the above with no luck.
What worked for me was to make a brand new project with Visual Studio and add all my files to the new project. Go figure... 6/14/2006 11:09 AM | Mau.NET

# Ensure that output Path should be \bin not \bin\Debug in web applications.

There is a Output path property in Project =>Properties=>Configuration Properties=>Build. Ensure that the value is set to \bin. 6/19/2006 3:36 PM | Yalaguresh

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

If you're using ASp.NEt 2.0, try placing the global.asax.cs file in the App_Code folder. It worked for me. 6/20/2006 12:11 PM | Matt

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

Check your recycle bin for the .aspx.cs and .resx files and if they are there restore them back to your web dir.

Check the .csproj file for your project. I found that two of the <File ... references had been removed (for some unknown reason) for the file that was having this error. If you don't have a file reference for the .aspx, .aspx.cs and the aspx.resx try this...
1. in Visual studio do Window-Close all Documents.
2. Close Studio.
3. Make sure your .csproj has 3 entries, "Bob" is the form name:
<File
RelPath = "Bob.aspx"
SubType ="Form"
BuildAction = "Content"
/>
<File
RelPath = "Bob.aspx.cs"
DependentUpon = "Bob.aspx"
SubType ="ASPXCodeBehind"
BuildAction = "Compile"
/>
<File
RelPath = "Bob.aspx.resx"
DependentUpon = "Bob.aspx.cs"
BuildAction = "EmbeddedResource"
/>

I got this problem after deleting and adding pages to my site - I think there might be a bug in VS because it tossed my aspx.cs and .resx in the trash when I deleted a different file.

6/26/2006 2:58 PM | Deb

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

worked for me when i changed the ASPNET version to 2.0 then back to 1.1 (despite it was showing this at the beginning) then apply in IIS, and after deleting the global.asax files in the project. hope this helps. 7/5/2006 11:42 AM | ReedSmith

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

Yeah ReedSmith your right, i just delete the global.asax and create another and walla, it works! 7/20/2006 5:39 AM | Ramil

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

I have this problem but the application that I am using is was working before and is prebuilt, I didn't compile anything. I deleted the app and installed a new copy and a new version, both are doing the same thing. The problem first appeared when I was working with module development for the app and I was compilling then. I suspect that the problem is somewhere in the configuration that the .net framework saves because when I move the newer version to .net framework 2 everything runs ok. 7/25/2006 5:24 PM | Bob Pope

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

I have this problem when trying to upload to my corporate server. It is in reference to the Excel, Word and PowerPoint .DLL's. its due to office (nor any of the indivdual programs) being installed on the server. 8/4/2006 3:33 PM | Inauxas Dicardum

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

I created a new project and it worked for me..
8/16/2006 10:23 AM | Amina

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

i am facing the same problem, please help 8/28/2006 6:58 PM | vaishali

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

Since Asp.Net 2.0, check that the web site or virtual folder are configured to use the 2.0 version, not 1.1 (which may be the default one). 9/11/2006 6:35 AM | M

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

Check the output path of the build under configuration Properties. It needs to be just "bin\". 9/12/2006 5:52 PM | Ryan

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

Best way to get rid of this error is to DELETE the Global.asax file and create it again. Copy the code inside temporarily and paste it back, when you create the file. This works. 9/14/2006 7:07 PM | Ravi R

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

Would somebody be as kind as to help me make my IIS connection. I want to run a website on my department's server, but under my IIS I only see my own computer. How do I publish on the dept server if I cannot find the server there? I do not see how to add the server as an IIS choice.

Thanks,
S 10/31/2006 4:09 PM | sarchamb

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

Also make sure to change the security.config file on the production IIS 11/2/2006 8:19 PM | ven yetukuri

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

Thanks for the help... this link solved the problem for me. (Our web files are on a SAN).
http://support.microsoft.com/kb/320268/en-us 11/13/2006 7:59 PM | Brenda

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

I had this same problem, was solved by ChuckG's solution above. Thanks mate. 11/15/2006 3:59 AM | Masty

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

Check all the references , in my case this error was comming because of a faulty reference dll when i fixed dat .. it fixed automatically... 11/15/2006 8:20 AM | Salman Zafar

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

If you're registering your .dlls in the GAC (c:\\windows\\assembly) make sure you do an iisreset to flush the cache. Otherwise whenever you try to run your .aspx page they are referencing a cached(old) version of your .dll. 11/16/2006 4:40 PM | Robert

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

Finally I solved it. The problem is that I tried to add some code to the Application_Start event and for that I clicked the Global.asax file and the selected the event from the combobox what generated the inline code and maybe deleted the golbal.asax.vb file in the App_code folder.

So, to solve the problem I just left the Global.asax code inaltered and put the Global.asax.vb file (you can find it in any zip file of the Dotnetnuke) in the App_Code folder. Rebuild!!

This took me more then 5 hours!!!! 12/7/2006 2:45 PM | Andre

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

I fixed this by deleteing the global.asax from my solution and adding a new global application class file, then rebuild the application.

Transfer all the updated bin\ files and the global.asax files to the remote machine.

I'm happy now! 12/8/2006 1:13 PM | Silo4

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

Thanks for help ,read the following article
http://support.microsoft.com/kb/320268/en-us 12/29/2006 6:18 AM | Anshuman

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

Not one of these fixes worked. I am still seeing the message when trying to debug my Managed C++ Web Service. Studio is VS 2005. OS is XP. IE is 6.0 sp 2. ASP.net is set to 2.0 in IIS. This error does not occur with same web service built on home machine with same OS same VS and same IE. 12/29/2006 2:06 PM | Edward Joell

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

I faced the same problem and i got the solution as well. Open the WebApplication1.vbproj file in NOTEPAD. You will be able to see one attribute --> RootNamespace = "WebApp". Also you might have added some Namespace in Global.asax.vb file. Check that first. If you have specified any Namespace like 'Name1' then your <%@ Application Codebehind="Global.asax.vb" Inherits="WebApp.Name1.Global" %> . If you have not given any Namespace then it should look like --> <%@ Application Codebehind="Global.asax.vb" Inherits="WebApp.Global" %>. This will solve the problem. Happy debugging. 2/1/2007 4:40 PM | Raj

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

thanks spamcannon it was the framework version for me. 2/8/2007 10:08 AM | adam

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

Not only should you ensure that the dlls are not being built in the debug folder, you should also check the release folder. 2/14/2007 12:36 AM | Eric

# Parser Error Message: Could not load type 'FrameWork.hubs.security.WebForm1'.

how to fix this? 3/5/2007 11:51 AM | ewe

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

Parser Error Message: There is not enough space on the disk.
3/9/2007 1:35 PM | Parabivger

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net pag

Hi ewe!

I had the same problem and i tried this:

1. went to the directory where my project were (let's call it "Example")

eg. C:\Inetpub\wwwroot\Example

2. Localized the directory named "bin" inside the directory of my project

e.g C:\Inetpub\wwwroot\IBSBranchNet\bin

3. Deleted the dll file with the same name of your project.

e.g Example.dll

4. Rebuild the entire project.

Hope this would help 8/7/2007 5:07 AM | Cesar Sanz

# Error<%@ Application Codebehind="Global.asax.vb" Inherits="My_Web.Global" %>

when i upload my project on the server i am getting this error....
Need suggestions........
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 'Worldfreezone.Global'.

Source Error:


Line 1: <%@ Application Codebehind="Global.asax.vb" Inherits="My_Web.Global" %>


1/2/2008 1:38 AM | Anu

# Error<%@ Application Codebehind="Global.asax.vb" Inherits="My_Web.Global" %>

when i upload my project on the server i am getting this error....
Need suggestions........

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
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 'my_Web.Global'.

Source Error:


Line 1: <%@ Application Codebehind="Global.asax.vb" Inherits="my_Web.Global" %>


1/2/2008 1:40 AM | Anu

# You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net page

Thanks 4 the solution. 1/23/2008 9:24 PM | Saquib Raza

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net pag

I found the reason why it wasn't working for me...

ie. if you have an asp application and you're trying to call a nice asp.net application, make sure that the folder containing the .net app is indeed an application - via IIS.

This can solve lots of issues!

Happy coding. 2/13/2008 8:21 PM | Farrel

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net pag

This can be easily resolved by rebuilding your solution. REMEMBER to check the build tick box for build options. 3/6/2008 1:44 PM | Carl Andrew S. Siy

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net pag

Had the same issue. I was able to resolve it by deleting the global.asax file and replacing it with a new global.asax file that contained no data. So...thanks Silo4 :) 3/11/2008 12:11 PM | albert

# FIXED: "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net pag

I was running into this on my site. I tried most of the stuff listed here before I found the FIX to my situation.

I looked in the Global.asax file and it didn't have any real code in here, so I deleted(removed from project) Global.asax, .resx, and .asax.vb.

The I rebuilt the site and redeployed. After that it worked.

3/18/2008 6:50 AM | LE

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net pag

Thanks for the help. 3/18/2008 6:52 AM | SA

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net pag

ChuckG's solution worked for me. Thanks a lot!! 5/22/2008 8:08 AM | Jason

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net pag

Still i have the same error.. 8/7/2008 11:42 PM | Mydeen

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net pag

hi , i m also facing same issue in my website hosted on a remote server, i have built the application and uploaded it, it was working fine but since this afternoon i m getting error that there is not enough disk space.

why such type of error can arise?

please reply me 8/25/2008 12:58 AM | arpan

# re: You may receive the error "Parser Error Message: Could not load type 'WebApplication1.Global'." when browsing an asp.net pag

Check file
c:\windows\microsoft.net\framework\v1.1.4322\Config\machine.config

At line 198
It must like this <add assembly="*" /> 8/29/2008 4:10 PM | cunt

# re: You may receive the error Parser Error Message: Could not load type 'WebApplication1.Global'. when browsing an asp.net page

I received this error because I modified the web.config file on C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG.
Really I copied my application's web.config (and renamed the original in web.config.temp) to make crypt/decrypt test on connection string... then I forgot to put everithing back and i received the error.
After putting the old file in the right place everithing was fine.
Hope helpfull.
Bye 9/12/2008 1:37 AM | Dario

Post a comment





 

Please add 2 and 6 and type the answer here: