IIS对Web根的写入权限

问题描述

我使用以下设置创建了IIS网站(ApplicationPool帐户名为Fitko

enter image description here

当我运行网站并提交带有图像的表单时,应用程序会抛出错误

UnauthorizedAccessException:访问路径 'C:\ IISWorkspace \ Fitko \ upload \ instructors'被拒绝。 System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)

我为这些帐户的Fitko文件夹授予了完全权限

但仍然抛出UnauthorizedAccessException异常。

如何授予IIS访问权限以写入文件夹?

解决方法

我通过启用windows authentication解决了这个问题(我之前曾使用过匿名身份验证,但可能可以同时启用)

enter image description here

设置在

Web Project > Properties > Debug > Web Server Settings

,即使将发布配置设置为release,该标志似乎也可以控制。

,

我认为,该问题通常表示特定文件夹的权限错误。 您的应用程序池标识是什么?尝试右键单击该文件夹,并授予Everyone Account对文件夹的完全访问权限。
enter image description here
此外,在某些情况下,这可能与我们的网站框架技术有关。 https://github.com/stryker-mutator/stryker-net/issues/272
随时让我知道问题是否仍然存在。