ASP.Net MVC"未能加载类型"当执行 [英] ASP.Net MVC "Could Not Load Type" when executing

查看:340
本文介绍了ASP.Net MVC"未能加载类型"当执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我从一个在线教程制作一个非常简单的ASP.Net MVC应用程序。我跟着它正好,一步一步,并尝试多次却不断收到同样的错误,当我执行code。

I have a very simple ASP.Net MVC Application that I have produced from an online tutorial. I've followed it exactly, step by step and have tried multiple times but keep getting the same error when I execute the code.

该计划只是显示一个索引页使用LINQ to SQL中列出的一系列数据从SQL Server数据库。

The program just displays an index page which lists a series of data from an sql server database using linq to sql.

这是错误:

未能加载类型'MvcApplication1.Views.Home.Index'。

Could not load type 'MvcApplication1.Views.Home.Index'.

任何想法的问题可能是什么?

Any ideas what the problem could be?

推荐答案

可能的答案在这里:

<一个href=\"http://www.jondavis.net/techblog/post/2009/04/29/Set-Up-IIS-For-An-MVC-App-When-All-Else-Fails-Check-View-Config.aspx\">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.

这篇关于ASP.Net MVC&QUOT;未能加载类型&QUOT;当执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆