尝试创建目录时,.NET MVC Access被拒绝 [英] .NET MVC Access denied when trying to create Directory
问题描述
我试图用 Directory.CreateDirectory
在.NET中创建一个目录,我按照这里给予访问权限,但我仍然得到一个UnauthorizedAccessException。有没有人有任何建议?注意,这是一个使用IIS7服务器的Web应用程序。
I am trying to create a Directory in .NET using Directory.CreateDirectory
, I followed the directions here to give access permission but I am still getting an UnauthorizedAccessException. Does anyone have any advice? Note, this is a web application that uses the IIS7 server.
推荐答案
在试图创建新目录的目录中,确保您的应用程序池用户具有该目录的读/写权限。除了将用户添加到用户组之外,您必须具体执行此操作。
In the directory you are attempting to create a new directory, make sure that your app pool user has Read/Write permissions for that directory. You have to specifically do that in addition to adding the user to the user groups.
这篇关于尝试创建目录时,.NET MVC Access被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!