Hi,
The error message indicates that ASP.NET process identity doesn't have enough permission on that folder.
The application that is deployed on IIS is running under "ASPNET" or "NETWORK SERVICE" basing on IIS version. These accounts have low privileges.
In this case, this folder is created at runtime, you can also set its ACL on folder. For example, you can add an ACL entry on the specified file for the specified account:
public static void AddFileSecurity(string fileName, string account,
FileSystemRights rights, AccessControlType controlType)
{
// Get a FileSecurity object that represents the
// current security settings.
FileSecurity fSecurity = File.GetAccessControl(fileName);
// Add the FileSystemAccessRule to the security settings.
fSecurity.AddAccessRule(new FileSystemAccessRule(account,
rights, controlType));
// Set the new access settings.
File.SetAccessControl(fileName, fSecurity);
}
For more information, see http://msdn.microsoft.com/en-us/library/system.io.file.setaccesscontrol.aspx
Note: Your application needs high permission to set ACL.
You also can consider using Impersonation, which impersonates a specific user. So you can use impersonation to access local resources and perform operations by using the authenticated user's identity or by using a specific Windows identity.
For more information, see How To: Use Impersonation and Delegation in ASP.NET 2.0 (http://msdn.microsoft.com/en-us/library/ms998351.aspx).
I look forward to receiving your test results.