ASP.NET无权访问所请求的资源。考虑将资源的访问权限授予ASP.NET请求标识。 [英] ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity.

查看:86
本文介绍了ASP.NET无权访问所请求的资源。考虑将资源的访问权限授予ASP.NET请求标识。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在浏览我的应用程序时遇到此错误。请帮助解决此问题



描述:执行当前Web请求期间发生了未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。



异常详细信息:System.UnauthorizedAccessException:拒绝访问路径'.. \\\\\\\\\\\\\\\\\\\\\\\\\\\\



ASP.NET无权访问所请求的资源。考虑将资源的访问权限授予ASP.NET请求标识。 ASP.NET具有基本进程标识(在IIS 5上通常为{MACHINE} \ ASPNET或在IIS 6上为网络服务),如果应用程序未模拟,则使用该标识。如果应用程序通过< identity impersonate =true>模拟,则标识将是匿名用户(通常为IUSR_MACHINENAME)或经过身份验证的请求用户。



要授予ASP.NET文件访问权限,请在资源管理器中右键单击该文件,选择属性,然后选择安全选项卡。单击添加以添加适当的用户或组。突出显示ASP.NET帐户,并选中所需访问的框。



来源错误:





第193行:

第194行:m_Javascripts = Directory.GetFiles(string.Format(@{0} \ js \,m_ApplicationPath),* .js,SearchOption.TopDirectoryOnly);

第195行:

第196行:DebugHelpers.WriteTrace(

解决方案

< blockquote>参考 - System.UnauthorizedAccessException:访问路径D:... \\\\\\\\\\\\\\ 被拒绝。 [ ^ ] 。

Quote:

不是向ASPNET用户授予权限,而是向NETWORK SERVICE用户授予权限。修改权限。文件夹应该足够,不需要提供完全权限(没有理由提供超过需要的权限)。

另见访问路径是否认。 [ ^ ]。


I got this error while browsing my application.Please help in solving this problem

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.UnauthorizedAccessException: Access to the path '..\Web\js' is denied.

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true">, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

Source Error:


Line 193:
Line 194: m_Javascripts = Directory.GetFiles(string.Format(@"{0}\js\", m_ApplicationPath), "*.js", SearchOption.TopDirectoryOnly);
Line 195:
Line 196: DebugHelpers.WriteTrace(

解决方案

Refer - System.UnauthorizedAccessException: Access to the path "D:...\thumbs\5B62060C102F6363635A.jpg" is denied.[^].

Quote:

Instead of granting permissions to ASPNET user, grant permissions to NETWORK SERVICE user. Modify permissions within the folder should be enough, no need to give full permissions (no reason to give more permissions than needed)

.
Also see Access to the path is denied.[^].


这篇关于ASP.NET无权访问所请求的资源。考虑将资源的访问权限授予ASP.NET请求标识。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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