我得到了错误

无法加载类型mvcapapplication

当我试图运行我的网站时。

如何纠正?


当前回答

对我来说,修正的方法是改变build选项卡的输出路径。 我把输出路径改为bin\,错误就消失了。

-另一个修复可能是你有错误的启动项目集。

其他回答

如果您更改了名称空间,请确保右键单击并重构。

对我有效的是重新启动Visual Studio。

我尝试手动重建,执行清理和重建,并删除bin文件夹,所有这些都没有工作。我的输出路径已经设置为bin\

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.

这与其他答案相关——如果你的web项目的程序集不可用,你会得到这个错误。但这可能是一个常见的场景,特别是因为您实际上编译了您的解决方案——项目只是没有得到构建。

我又犯了这个错误,上面没有一个对我有用。我必须删除下面的节点在.csproj文件:<VisualStudio>....</VisualStudio>。重新加载VS,它工作了。

仅供参考,VS能够重新创建节点,然后我在IIS中重新创建了网站(通过VS),它工作得很好。

希望这能帮助到一些人。

尽管听起来很傻,但我尝试了所有的方法,它都不工作,最后重新启动VS2012,看到它又工作了。