Reputation: 11794
I am trying to save xml to a certain location like this:
private void UpdateXMLFile(XElement xmlFeed,string xmlFileLocation)
{
xmlFeed.Save(xmlFileLocation);
}
I have added SYSTEM, NETWORK SERVICE and Administrators all with all permissions to the folder I am saving in but I still get this error?
System.UnauthorizedAccessException Access to the path 'c:\temp\myfile.xml' is denied
I am using an asp.net 3.5 application (iis 7) to do this. The identity of the application is the 'ApplicatonPoolIdentity'
Upvotes: 0
Views: 1134
Reputation: 19830
In my options there are two possibilities:
Upvotes: 0
Reputation: 11227
you need to add write permissions for user IIS APPPOOL\[your app pool name] to that folder. This user is created "under the hood" when you create an app pool, and you can find them in your "local users" manager:
Upvotes: 2