发布asp.net MVC后,403禁止 [英] 403 forbidden after publishing asp.net MVC

查看:543
本文介绍了发布asp.net MVC后,403禁止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这已经回答了几次,但没有一个解决方案,为我工作。我发表我的ASP.NET MVC 3应用程序(这只是没有任何改变互联网模板),看看我是否能得到它的工作公开。然而,当我访问该网站,它显示了一个403错误。我来自一个PHP / Linux的背景下,我很困惑,不知道去哪里找。我只学习.NET约8-9个月,一切我一直在测试之前是通过VS2010在本地开发服务器上。它几乎看起来像犯规知道它应该是一个MVC应用程序或者我必须改变我的路由服务器。

反正,我检查,以确保服务器设置为.NET 4任何帮助将是很大的AP preciated。

此外,它是一个共享的托管环境中使用arvixe。

解决方案

对于我这个由 Mmerrell 在<一个href="http://stackoverflow.com/questions/5111091/getting-404-0-error-for-asp-net-mvc-3-app-on-iis-7-0-windows-server-2008?answertab=votes#tab-top">Getting 404.0错误在IIS 7.0 ASP.NET MVC 3应用程序/ Windows Server 2008的

  

您实际上只是提醒我,我需要解决这个问题的   环境在这里。如果你的情况是和我一样那么这是一个   简单的解决方法。

     

只需添加以下到您的网络配置:

 &LT; system.webServer&GT;
    &LT;模块runAllManagedModulesForAllRequests =真/&GT;
 

请确保你已经选择了ASP.Net 4.0应用程序池,而不是应用程序池为应用程序创建的。 确保您的应用程序池使用ApplicationPoolIdentity,而不是网络服务。取下你的根文件夹中的网络服务权限。你不需要它。 IIS有一个内置的标识(IIS_IUSRS)。

I know this has been answered a few times but none of the solutions worked for me. I published my ASP.NET MVC 3 application (It was just the internet template without any changes to it) to see if I could get it to work publically. However, when I visit the site it shows up with a 403 error. Coming from a php/linux background, I'm confused and have no clue where to look. I've only been learning .NET for about 8-9 months and everything I've been testing on before was on the local development server through VS2010. It almost appears like the server doesnt know it should be an MVC application or I have to change my routing.

Anyway, I checked to make sure that the server setting is .NET 4. Any help would be greatly appreciated.

ALSO, It's a shared hosting environment using arvixe.

解决方案

For me this did the trick (Original Answer by Mmerrell at Getting 404.0 error for ASP.NET MVC 3 app on IIS 7.0 / Windows Server 2008 )

You actually just reminded me that I needed to fix this issue in an enviroment here. If your situation is the same as mine then it's a simple fix.

Just add the following to your web config:

 <system.webServer> 
    <modules runAllManagedModulesForAllRequests="true" /> 

Make sure your have choosen the "ASP.Net 4.0" App-Pool and not the App-Pool created for your application. Make sure your App Pool uses the "ApplicationPoolIdentity" and NOT NetworkService. Remove the NetworkService permission from your root folder. You dont need it. IIS has an built-in identity (IIS_IUSRS).

这篇关于发布asp.net MVC后,403禁止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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