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

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

源错误:

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

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

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


当前回答

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

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

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

其他回答

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.

“BUILD ->配置管理器和——嗯哼——勾选我的项目旁边的复选框,以确保它实际上得到了构建。” 然后在windows资源管理器中打开项目文件夹,按下选项并取消“只读”复选框。

重新创建虚拟目录为我解决了这个问题。

(在此之前,我尝试了这里列出的其他建议,如清理解决方案,删除bin文件夹,重建解决方案等。没有一个工作,直到我重新创建虚拟目录)

Debug ->调试属性-> Web ->创建虚拟目录

我不得不说,我尝试了这篇文章中的至少4条建议。没有一个成功。然而,我很高兴地告诉大家,我从备份中恢复过来了。只需要更新日志文件中最后的代码更改。花了不到10分钟。花了3倍的时间阅读这篇文章并尝试其他建议。对不起。

这是一个非常奇怪的错误。祝其他遇到这个小妖精的人好运。

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