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

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

源错误:

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

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

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


当前回答

我是这样解决问题的: 只需修复Global.asax中的命名空间。

其他回答

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

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.

尝试修改全局变量。Asax文件(简单添加一个空格的地方),并重新运行。这将迫使内置的web服务器刷新和重新编译全局。asax文件。

也做一个清理和重建-应该修复问题

您的本地web服务器运行的代码与您实际使用的代码不同。确保你已经停止调试,停止你的本地web服务器,按照Peter的建议清理和重建,仔细检查你的全局。Asax和global.asax.cs,再试一次。

如果这不起作用,并且您使用的是本地IIS,请尝试在IIS管理器中删除站点并手动重新创建它。

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