Error: «Could not load type MvcApplication»

后端 未结 30 1459
心在旅途
心在旅途 2020-11-28 02:18

I am getting the error

Could not load type MvcApplication

when I try to run my website.

How to correct it?

相关标签:
30条回答
  • 2020-11-28 02:32

    If you're hosting in IIS express and you open your project in two different locations, then you might see this error.

    The solution is to go to Project/Properties/Web/Servers and click Create Virtual Directory.

    0 讨论(0)
  • 2020-11-28 02:32

    I already had bin/ in my build tab. I got global.asax from another copy of the project, but that didn't work out.

    The solution that finally worked for me was to remove the bin/ folder and create a new empty folder with the same name.

    0 讨论(0)
  • 2020-11-28 02:32

    Make sure you shouldn't have to open the MVC project like File->Open Web Site use File->Open Project instead.

    0 讨论(0)
  • 2020-11-28 02:35

    -For me, the fix was to change the output path in the build tab. I changed the output path to bin\ and the error went away.

    -Another fix could be that you have the wrong start up project set.

    0 讨论(0)
  • 2020-11-28 02:37

    I was getting the same error and inspite of doing everything mentioned here and elsewhere nothing worked. Turned out that I had copied the source code of global.asax.cs from a previous version of the project which had a different name. So the namespace Test should have been namespace Test.WebUI. A silly mistake of course and am a bit embarrassed to write this! But writing in the hope that a similar error from anyone else may lead him to check this trivial aspect as well.

    0 讨论(0)
  • 2020-11-28 02:39

    The solution for me was to right click on the Mvc project, choose properties and click Create Virtual Directory.

    A message box popped up saying that the project was mapped to the wrong folder (it showed the folder for a different TFS project. It gave the option to map it back to the correct folder.

    0 讨论(0)
提交回复
热议问题