[英]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.