views:

155

answers:

1

When I attempt to save an image file to a virtual directory I get "A generic error occurred in GDI+." This seems to be a permission issue, because during the debug process, I changed the file path to my local hard drive and was able to save the file.

The virtual directory is running under a specific domain account, with full control given to the folder and the share. IIS is serving the images, and I can navigate through the directory structure of the virtual directory in IIS, and also save, rename and delete files in the folder while connected as the domain account.

When I attempt to save the file from the application, does IIS connect as some other user, other than me or the domain account?

Any help with this would be appreciated!

A: 

After some Googling we found a blog post by Rick Strahl which fixed the problem. To determine the account that the application in running under we used <%= Environment.UserName %> - this returned ASPNET (IIS 5.1 - does not have appPools)

We then added a username and password to the machine.config so the app would run under an account that we specified and not the ASPNET account

C:\windows\Microsoft.NET\Framework\v2.0.50727\CONFIG

Hope this helps someone!

Neil