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

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

源错误:

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

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

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


当前回答

我也得到了同样的错误…检查您正确开发的应用程序的名称。分配的名称空间和程序集名称,并尝试物理地更改为应用程序创建的文件夹名称,所有这些都应该与文件global.asax中出现的上述名称空间中的名称相同

其他回答

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.

我也面临着同样的问题。尽管遵循每一个答案,它没有工作。 然后我将“Inherits=namespace.class”更改为“Inherits=完全限定的组装名”,即“Inherits=namespace.class,assemblyname, Version=, Culture=, PublicKeyToken=” 希望能有所帮助。

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

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

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

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

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