I am getting the error
Could not load type MvcApplication
when I try to run my website.
How to correct it?
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.