简体   繁体   English

没有授权ASP.NET访问请求的资源。 可以在调试模式下访问文件夹,但是在IIS上部署时无法访问

[英]ASP.NET is not authorized to access the requested resource. Can access a folder in debug mode but not when I deploy it on IIS

My MVC application was running fine(hosted on my local machine) but after restarting the system it is not able to access a network folder. 我的MVC应用程序运行正常(位于我的本地计算机上),但是重新启动系统后,它无法访问网络文件夹。 However, in debug mode it is running fine but when I publish it it doesn't work. 但是,在调试模式下,它运行良好,但是当我发布它时,它不起作用。

Exception Details: System.UnauthorizedAccessException: Access to the path '\\abc\\xyz.txt' is denied. 异常详细信息:System.UnauthorizedAccessException:拒绝访问路径'\\ abc \\ xyz.txt'。

The machine 'abc' is accessible to everyone on the network. 网络上的每个人都可以访问机器“ abc”。

A possible solution is that the folder gives write permissions to the Network Service user account or it will never work. 一种可能的解决方案是该文件夹向网络服务用户帐户授予写权限,否则它将永远无法使用。 Also make sure that the aspnet user has write permissions on the folder too. 还要确保aspnet用户也对该文件夹具有写权限。

Check the app pool identity it's running under. 检查正在运行的应用程序池标识。 Ensure the identity has permissions to access the folder. 确保身份具有访问该文件夹的权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ASP.NET访问临时文件夹时无权访问请求的资源 - ASP.NET is not authorized to access the requested resource when accessing temp folder 没有授权ASP.NET访问SSRS的请求资源 - ASP.NET is not authorized to access the requested resource For SSRS Microsoft Azure Web App-未授权ASP.NET访问所请求的资源 - Microsoft Azure Web App - ASP.NET is not authorized to access the requested resource 无法找到该资源。 当我在IIS7上部署ASP.net时 - The resource cannot be found. When I deploy ASP.net on IIS7 ASP.net拒绝访问文件夹在IIS上不起作用 - ASP.net deny access to folder doesn't work on IIS .NET Core 2.0中的CORS“请求的资源上没有'Access-Control-Allow-Origin'标头。” - CORS in .NET Core 2.0 “No 'Access-Control-Allow-Origin' header is present on the requested resource.” ASP.NET 2.0:为什么我的类在本地计算机上运行时可以访问Session对象,而在将其部署到服务器时不能访问? - ASP.NET 2.0: Why can my class access the Session object when run on my local machine, but not when I deploy it to the server? asp.net文件夹访问 - asp.net folder access 调试和部署时,ASP.NET登录看起来有所不同吗? - ASP.NET login looks different when I debug and deploy? ASP.NET无法访问具有IIS角色权限的页面 - ASP.NET Can't access pages with role permissions on IIS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM