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

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

源错误:

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

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

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


当前回答

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

其他回答

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.

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

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

对我来说,解决办法不是以上任何一种。 我必须删除(而不是重新创建)全局。和Global.asax.cs。 这些文件存在于文件夹中,即使它们在项目中没有被引用。 显然那个建筑还看见了他们。 因为我在Startup.cs中使用了OWIN, Global。Asax文件已经过时,删除它没有问题。

我有同样的问题,当我有2个实例的Visual Studio运行相同的项目。所以我关闭了两个Visual Studio,只打开了一个实例,它现在工作得很好!

我在一个非常古老的溶液中有这个。事实证明,真正的问题是这些项目构建到4.6.1,而不是其他被引用的dll构建到4.7.2。在将解决方案中的所有项目更改为4.7.2后,它成功构建并运行应用程序。