[英].NET MVC Access denied when trying to create Directory
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. 我正在尝试使用Directory.CreateDirectory在.NET中创建
Directory.CreateDirectory
,我按照此处的指示进行访问,但仍收到UnauthorizedAccessException。 Does anyone have any advice? 有人有建议吗? Note, this is a web application that uses the IIS7 server.
注意,这是一个使用IIS7服务器的Web应用程序。
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.
除了将用户添加到用户组之外,还必须专门执行此操作。
2 more potential issues (+1 to user959729): 另外2个潜在问题(对user959729 +1):
System.Environment.UserName
before creating directory). System.Environment.UserName
)。 To fix you need to run code as process account.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.