我得到了错误

无法加载类型mvcapapplication

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

如何纠正?


当前回答

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项目的程序集不可用,你会得到这个错误。但这可能是一个常见的场景,特别是因为您实际上编译了您的解决方案——项目只是没有得到构建。

其他回答

我有同样的问题,解决它与以下步骤

转到项目属性 在“Build”选项卡上,将输出路径设置为“bin\”

对我来说,修正的方法是改变build选项卡的输出路径。 我把输出路径改为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项目的程序集不可用,你会得到这个错误。但这可能是一个常见的场景,特别是因为您实际上编译了您的解决方案——项目只是没有得到构建。

你必须检查action方法,在调用重载实参或无效实参的方法时,是否有一个或多个方法

public string test(string a, string b){

}

public ActionResult x(){
     test(a) //test is need two arguments
}