asp.net-mvc 403 - 禁止:访问被拒绝。ASP.NET MVC
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2805311/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
403 - Forbidden: Access is denied. ASP.Net MVC
提问by Ali
Possible Duplicate:
ASP MVC in IIS 7 results in: HTTP Error 403.14 - Forbidden
I published my application on server. When I enter my domain i got this error:
我在服务器上发布了我的应用程序。当我进入我的域时,出现此错误:
403 - Forbidden: Access is denied. You do not have permission to view this directory or page using the credentials that you supplied.
403 - 禁止:访问被拒绝。您无权使用您提供的凭据查看此目录或页面。
What's happend?
发生了什么?
回答by almog.ori
Are you hosting the site on iis? if so make sure the account your website runs under has access to local file system?
您是在 iis 上托管网站吗?如果是这样,请确保您的网站运行的帐户可以访问本地文件系统?
Straight from msdn .....
直接来自msdn .....
The Network Service account has Read and Execute permissions on the IIS server root folder by default. The IIS server root folder is named Wwwroot. This means that an ASP.NET application deployed inside the root folder already has Read and Execute permissions to its application folders. However, if your ASP.NET application needs to use files or folders in other locations, you must specifically enable access.
默认情况下,网络服务帐户对 IIS 服务器根文件夹具有读取和执行权限。IIS 服务器根文件夹名为 Wwwroot。这意味着部署在根文件夹内的 ASP.NET 应用程序已经对其应用程序文件夹具有读取和执行权限。但是,如果您的 ASP.NET 应用程序需要使用其他位置的文件或文件夹,您必须专门启用访问。
To provide access to an ASP.NET application running as Network Service, you must grant access to the Network Service account.
要提供对作为网络服务运行的 ASP.NET 应用程序的访问权限,您必须授予对网络服务帐户的访问权限。
To grant read, write, and modify permissions to a specific file
授予对特定文件的读取、写入和修改权限
- In Windows Explorer, locate and select the required file.
- Right-click the file, and then click Properties.
- In the Properties dialog box, click the Security tab.
- On the Security tab, examine the list of users. If the Network Service
- account is not listed, add it.
- In the Properties dialog box, click the Network Service user name, and in the Permissions for NETWORK SERVICE section, select the Read, Write, and Modify permissions.
- Click Apply, and then click OK.
- 在 Windows 资源管理器中,找到并选择所需的文件。
- 右键单击该文件,然后单击“属性”。
- 在“属性”对话框中,单击“安全”选项卡。
- 在安全选项卡上,检查用户列表。如果网络服务
- 帐户未列出,请添加它。
- 在“属性”对话框中,单击“网络服务”用户名,然后在“网络服务的权限”部分中,选择“读取”、“写入”和“修改”权限。
- 单击应用,然后单击确定。
Click herefor more
点击这里了解更多
回答by robasta
In addition to the answers above, you may also get that error when you have Windows Authenticaton set and :
除了上面的答案之外,当您设置了 Windows Authenticaton 并且:
- IIS is pointing to an empty folder.
- You do not have a default document set.
- IIS 指向一个空文件夹。
- 您没有默认文档集。
回答by Rick
I just had this issue, it was because the IIS site was pointing at the wrong Application Pool.
我刚刚遇到这个问题,这是因为 IIS 站点指向错误的应用程序池。
回答by Petr
I had the same issue (on windows server 2003), check in the IIS console if you have allowed ASP.NET v4 service extension (under IIS / ComputerName / Web Service extensions)
我遇到了同样的问题(在 Windows Server 2003 上),如果您允许 ASP.NET v4 服务扩展(在 IIS / ComputerName / Web Service extensions 下),请检查 IIS 控制台