System.UnauthorizedAccessException on IIS7.5, full control everywhere

倾然丶 夕夏残阳落幕 提交于 2019-12-11 11:45:23

问题


I'm trying to get an ASP.NET Web API application running on IIS7.5. I've added an application tot the default web site for it. It's running in the DefaultAppPool, with anonymous authentication enabled and ASP.NET impersonation disabled. The Web API works fine: I can run it and it returns results.

However, when I call an operation that is supposed to return an image, I get a System.UnauthorizedAccessException. I figured it's just an authorization issue, so I went to the file's security dialog and gave the IIS AppPool\DefaultAppPool user full control. This did not work. I then tried to give Everyone full control on the file, but I still got the exception.

I'm at a loss. What could be going on here?


回答1:


I've since found the solution... but I'm not sure why. Rather than going to the folder properties > Security > Edit... > Add... > and adding IIS AppPool\DefaultAppPool I went to the folder and chose properties > Advanced... > Change Permissions... > Add.. and added the IIS AppPool\DefaultAppPool user there. What's the difference between those two methods?



来源:https://stackoverflow.com/questions/16962587/system-unauthorizedaccessexception-on-iis7-5-full-control-everywhere

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!