[asp.net] Could not load type 'XXX.Global'

Migrating a project from ASP.NET 1.1 to ASP.NET 2.0 and I keep hitting this error.

I don't actually need Global because I am not adding anything to it, but after I remove it I get more errors.

This question is related to asp.net visual-studio

The answer is


I fixed this error by simply switching from Debug to Release, launch program (It worked on release), then switch back to Debug.

I tried just about everything else, including restarting Visual Studio and nothing worked.


If your using visual studio 2010 this error can occur when you change the configuration deployment type. The 3 types are x86, x64 and Mixed mode. Changing to mixed mode setting for all projects in solution should resolve the issue. Don't forget to delete the bin, Lib files and change the tempdirectory output if your an ASP.NET website.


Deletin obj, bin folders and rebuilding fixed my issue


I had this same problem installing my app to a server. It ended up being the installer project, it wasn't installing all the files needed to run the web app. I tried to figure out where it was broken but in the end I had to revert the project to the previous version to fix it. Hope this helps someone...


This one drove me completely insane and I couldn't find anything helpful to solve it. This is probably not the reason most people have this issue but I just hope that someone else will benefit from this answer.

What caused my problem was a <clear /> statement in the <assemblies> config section. I had added this because in production it had been required because there were multiple unrelated applications on the same hosting plan and I didn't want any of them to be affected by others. The more correct solution would have been to have just used web config transforms on publish.

Hope this helps someone else!


Had this error in my case I was renaming the application. I changed the name of the Project and the name of the class but neglected to change the "Assembly Name" or "Root namespace" in the "My Project" or project properties.


I had this problem.

I solved it with this solution, by giving CREATOR OWNER full rights to the Windows Temp folder. For some reason, that user had no rights at all assigned. Maybe because some time ago I ran Combofix on my computer.


When you try to access the Microsoft Dynamics NAV Web client, you get the following error. Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 This error can occur when there are multiple versions of the .NET Framework on the computer that is running IIS, and IIS was installed after .NET Framework 4.0 or before the Service Model in Windows Communication Foundation was registered.

For Windows 7 and Windows Server 2008, use the ASP.NET IIS Registration Tool (aspnet_regiis.exe,) to register the correct version of ASP.NET. For more information about the aspnet_regiis.exe, see ASP.NET IIS Registration Tool at Microsoft web site.

try this solution https://www.youtube.com/watch?v=LNwpNqgX7qw


In my case, a AfterBuild target in the project to compile the web application was the reason for this error.

See here for more info


I've found that it happens when the Global.asax.(vb|cs) wasn't converted to a partial class properly.

Quickest solution is to surround the class name 'Global' with [square brackets] like so (in VB.Net):

Public Class [Global]
    Inherits System.Web.HttpApplication
    ...

Ensure compiled dll of your project placed in proper bin folder.

In my case, when i have changed the compiled directory of our subproject to bin folder of our main project, it worked.


Deleting the existing global.asax file and adding a new one, clears out this error. This has worked for me many times.


In my case, I was duplicating an online site locally and getting this error locally in Utildev Cassini for asp.net 2.0. It turned out that I copied only global.asax locally and didn't copy the App_code conterpart of it. Copying it fixed the problem.


This just happened to me and after trying everything else, I just happened to notice on the error message that the app pool was set to .Net 1.1. I upgraded the app to 2.0, converted to web application, but never changed the app pool:

Version Information: Microsoft .NET Framework Version:1.1.4322.2490; ASP.NET Version:1.1.4322.2494


The reason I encounter this issue is because I change the build configuration. When I set a web project to x86, it changes the output path to bin\x86\Debug. However, the output path should be bin and the web server won't find the binaries because of this.

The solution thus is to change the output path of the website back to bin after you change the build configuration.


Changing the address's port number (localhost:) worked for me :)


Removing Language="c#" in global.asax file resolved the issue for me.