且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

ASP.Net MVC"未能加载类型"当执行

更新时间:2022-04-27 23:24:48

可能的答案在这里:

http://www.jondavis.net/techblog/post/2009/04/29/Set-Up-IIS-For-An-MVC-App-When-All-Else-Fails-Check-View-Config.aspx

基本上,浏览目录的web.config添加到您的目标视图目录。虽然,它听起来并不像你使用的是强类型的视图,或者没有部署code。

Basically, add the Views directory's web.config to your target Views directory. Although, it doesn't sound like you're using a strongly typed view, or aren't deploying your code.

另外,我已经看到了这个问题还会出现,如果从web.config中删除编译设置。在Visual Studio 2008中创建ASP.NET MVC项目,这些设置都包含在web.config中,它们应该保持要不然会出现此错误。

Also, I have seen this problem also appear if the compile settings are removed from web.config. In an ASP.NET MVC project created in Visual Studio 2008, those settings are included in web.config, and they should remain or else this error will occur.