我在一个MVC3项目上工作,收到以下错误:

解析器错误信息:无法加载类型“GodsCreationTaxidermy.MvcApplication”。

源错误:

第1行:<%@ Application Codebehind="Global.asax.cs" Inherits="GodsCreationTaxidermy.Core. core . "MvcApplication" Language=" c# " %>

我得到的错误是无法加载GodsCreationTaxidermy.Core.MvcApplication,但在这个屏幕截图中,核心部分没有显示在错误中:

有人对这个错误有什么想法或解决方案吗?


当前回答

我关闭和重开了视觉工作室,它工作。

其他回答

我也面临着同样的问题。尽管遵循每一个答案,它没有工作。 然后我将“Inherits=namespace.class”更改为“Inherits=完全限定的组装名”,即“Inherits=namespace.class,assemblyname, Version=, Culture=, PublicKeyToken=” 希望能有所帮助。

我的应用程序是在VS的旧版本中构建的,并且没有bin文件夹。我已经将它升级到一个更新的版本,但是在部署它时遇到了一个噩梦。我终于追踪到这个错误的项目>属性>应用程序。目标框架设置为2.0;在服务器上更改它以匹配IIS管理器/应用程序池,为我解决了这个问题。

我用很简单的方法修好了它。你所要做的就是删除ProjectName\bin文件夹中的所有文件,然后从Visual studio顶部菜单栏Build->Rebuild Solution再次重建项目,你就完成了。现在试着运行这个项目。这个过程在Visual Studio 2022中为我工作。

我关闭和重开了视觉工作室,它工作。

Yes, I read all the answers. However, if you are me and have been pulling out all of what's left of your hair, then try checking the \bin folder. Like most proj files might have several configurations grouped under the XML element PropertyGroup, then I changed the OutputPath value from 'bin\Debug' to remove the '\Debug' part and Rebuild. This placed the files in the \bin folder allowing the Express IIS to find and load the build. I am left wondering what is the correct way to manage these different builds so that a local debug deploy is able to find and load the target environment.