Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 958
Brian G Avatar asked Sep 10 '08 13:09

Brian G


2 Answers

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.

like image 127
Pieter van Ginkel Avatar answered Oct 13 '22 23:10

Pieter van Ginkel


There are a few things you can try with this, seems to happen alot and the solution varies for everyone it seems.

  • If you are still using the IIS virtual directory make sure its pointed to the correct directory and also check the ASP.NET version it is set to, make sure it is set to ASP.NET 2.0.

  • Clear out your bin/debug/obj all of them. Do a Clean solution and then a Build Solution.

  • Check your project file in a text editor and make sure where its looking for the global file is correct, sometimes it doesnt change the directory.

  • Remove the global from the solution and add it back after saving and closing. make sure all the script tags in the ASPX file point to the correct one after.

  • You can try running the Convert to Web Application tool, that redoes all of the code and project files.

  • IIS Express is using the wrong root directory (see answer in VS 2012 launching app based on wrong path)

Make sure you close VS after you try them.

Those are some things I know to try. Hope one of them works for you.

like image 24
pete blair Avatar answered Oct 13 '22 23:10

pete blair