Error: «Could not load type MvcApplication»

后端 未结 30 1463
心在旅途
心在旅途 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:51

    I know there are lots of solutions to this already, but I thought I'll just mention what solved it for me.

    My configuration was set to Debug. Changing it to Release did the trick for me.

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

    I was getting this error because I was running the project despite some compile time errors. This I didn't notice.

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

    In some circumstances, new projects you create are not by default set to build. If you right-click on your solution, choose Properties, and choose the Configuration Properties | Configuration node on the left and ensure your project has a checkmark under the Build column. In normal circumstances I've found this happens by default. In other circumstances (I happen to have a somewhat complex Web Api / Xamarin Android and iOS / Mvc 5 solution that exhibits this behavior) the checkmark isn't present.

    This is related to the other answers -- if your web projet's assembly is unavailable, you get this error. But this might be a common scenario, especially since you do in fact compile your solution -- the project just doesn't get built.

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

    This can also happen while running the project in visual studio if your IIS Express has/is hosting an old/different project using the same port assignment.

    To fix this, you can change the port assignment for this project or close IIS Express.

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

    What worked for me was restarting Visual Studio.

    I tried manually rebuilding, performing a clean and rebuild, and deleting the bin folder all of which did not work. My output path was already set to bin\

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

    If you changed a namespace make sure to right click and refactor.

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