I'm trying to resolve a file write issue in porting our IIS 6 / .NET 3.5 application to IIS 7. We have a temporary image directory where some server controls create images; in the past we would grant the Network Service account access to this directory and things just worked.
Now, this fails:
FileInfo
file = new FileInfo(@"C:\approot\_images\temp\test.txt");
if(file.Exists == false)
file.Create();
System.UnauthorizedAccessException : Access to the path 'C:\approot\_images\temp\test.txt' is denied.
This _images directory is setup for anonymous access; the application is setup for Windows Authentication and impersonation is on. If I turn impersonation off the file is created successfully....
I have the NTFS permissions for this temp directory wide-open, trying to solve the problem; so I have the IUSR account with full rights, along with IIS_IUSRS, Everyone, Network Service, Anonymous, etc... nothing I do allows the file to be created...
Any thoughts? This all works in IIS 6... the application pool is running in Classic Mode and set to Network Service.