Reputation: 4202
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.
Upvotes: 0
Views: 2386
Reputation: 100630
2 more potential issues (+1 to user959729):
System.Environment.UserName
before creating directory). To fix you need to run code as process account.Upvotes: 1
Reputation: 1187
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.
Upvotes: 2