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

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

源错误:

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

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

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


当前回答

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.

其他回答

您还可以在IIS中检查站点的属性。(在IIS中,右键单击站点,选择“属性”。)确保物理路径设置指向您的应用程序的正确路径,而不是其他应用程序。(这为我解决了这个错误。)

清空bin文件夹。构建所有依赖类库并在主项目中引用它们,然后构建完整的解决方案。

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

有两种方法:

配置管理器将dll构建显示为'64'和'any cpu'构建的混合。 将它们都放在同一个构建中可以解决这个问题。 在分支之间切换时,IIS快速路径有时不会更新。右键单击任务栏中的“IIS Express”>显示所有应用程序,并验证路径是否指向正确的分支。

无法加载项目的错误 首先修复你的错误,重建项目后,它的工作