本文介绍了MVC3错误消息:.cshtml类型您请求的页面不提供服务,因为它已被禁止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经部署应用MVC3
I have deployed mvc3 application in IIS 7
在运行集成.NET 4的模式。任何人都可以请指导?
It is running as integrated .net 4 mode. Can anyone please guide?
错误信息是:您所请求的页面的类型不提供服务,因为它已被明确禁止的。
Error message is: The type of page you have requested is not served because it has been explicitly forbidden
推荐答案
检查事项:
- 如果在.NET 4.0之后安装的,你需要在服务器上运行IIS 与IIS注册它
- 应用程序池设置为集成模式下运行
- 在你的web.config你有
<模块runAllManagedModulesForAllRequests =真/>
设置 - 您与访问您的网站
的http://服务器的/ home /指数
(改变控制器和动作名字来匹配你的) - 您有将匹配
{控制器} / {行动}
URL路由你的的Global.asax
- 相应的视图存在于
〜/查看/主页/ Index.cshtml
。
- If IIS was installed after .NET 4.0 on the server you need to run aspnet_regiis.exe to register it with IIS
- The application pool is set to run in integrated mode
- In your web.config you have the
<modules runAllManagedModulesForAllRequests="true"/>
set - You are accessing your site with
http://server/home/index
(change the controller and action names to match yours). - You have a route that will match the
{controller}/{action}
url in yourGlobal.asax
. - The corresponding view exists in
~/Views/Home/Index.cshtml
.
这篇关于MVC3错误消息:.cshtml类型您请求的页面不提供服务,因为它已被禁止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!