我得到了错误
无法加载类型mvcapapplication
当我试图运行我的网站时。
如何纠正?
我得到了错误
无法加载类型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项目的程序集不可用,你会得到这个错误。但这可能是一个常见的场景,特别是因为您实际上编译了您的解决方案——项目只是没有得到构建。
其他回答
我已经有bin/在我的构建标签。我是全球化的。Asax从另一个项目的副本,但没有工作。
最终对我有效的解决方案是删除bin/文件夹,并创建一个具有相同名称的新空文件夹。
检查global.asax中提供的信息背后的代码。它们应该正确地指向后面代码中的类。
示例global.asax:
<%@ Application Codebehind="Global.asax.cs" Inherits="MyApplicationNamespace.MyMvcApplication" Language="C#" %>
背后的示例代码:
namespace MyApplicationNamespace
{
public class MyMvcApplication : System.Web.HttpApplication
{
protected void Application_Start( )
{
AreaRegistration.RegisterAllAreas( );
FilterConfig.RegisterGlobalFilters( GlobalFilters.Filters );
RouteConfig.RegisterRoutes( RouteTable.Routes );
BundleConfig.RegisterBundles( BundleTable.Bundles );
}
}
}
我正在使用Azure移动应用程序,当我添加MVC控制器时,出现了这个问题。如果你从团队资源管理器(撤销)中删除所有文件,你需要从解决方案文件夹中删除bin, obj和Global.asax.cs
我刚遇到ASP的问题。NET MVC Web API项目,没有一个解决方案做到了戏法。
我重新启动机器,设法解决了这个问题。我升级了Visual Studio 2013,不需要重新启动,但这可能是导致问题的原因。
对我来说,修正的方法是改变build选项卡的输出路径。 我把输出路径改为bin\,错误就消失了。
-另一个修复可能是你有错误的启动项目集。