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

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

源错误:

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

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

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


当前回答

有两种方法:

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

其他回答

I faced the problem in VS 2017 out of no where, took my whole day going through 100 of solutions any of these didnt work. I then took my whole solution and started it on different machine having VS 2017 installation.. IT FINALLY WORKED. Than reinstalled VS 2017 on the original one and it started running on that too. I strongly recommend you try your solution on a different machine before wasting much time to debug it, bcz it is a BUG in VS 2017 as it seemed for me, have reported same to VS TEAM. Hope this helps any one in grief. Cheers.

从解决方案根目录中删除.vs目录。清洁。重建。

这个问题有时会让我发疯,我不可避免地会在这里翻找答案。我怀疑有多种原因可以产生这种异常,这一次为我工作。

我花了整整一天的时间来解决这个问题。

唯一有效的方法是删除.sln文件,创建一个新文件,然后将项目一个一个地添加回去。

¯\_(五)_/¯- Programming -¯\_(五)_/¯

对于我来说,web组装是GAC的一部分……因此,在构建后,它需要安装在GAC和它工作。

我试过这里的所有方法,但都没用。我的项目是在VS 2013。我已经升级到VS 2015,并在2015年创建了我所有的新应用程序,但加载、编译、构建等所有在2013年构建的旧应用程序。

我最终在2015年加载了解决方案,它为我解决了这个问题。