Common mistake in GDI + - permissions

When I try to save the image file in a virtual directory, I get "General Error in GDI +". This seems like a resolution issue because during the debugging process I changed the file path to the local hard drive and was able to save the file.

The virtual directory runs under a specific domain account with full control provided to the folder and shared folder. IIS serves the images, and I can navigate the directory structure of the virtual directory in IIS, as well as save, rename and delete files in a folder when connected as a domain account.

When I try to save a file from an application, does IIS connect to a user other than me or a domain account?

Any help with this would be appreciated!

+3
source share
1 answer

After some Googling, we found a blog post by Rick Strall that fixed the problem. To determine the account that the application started when using <% = Environment.UserName%> - this returned ASPNET (IIS 5.1 - does not have appPools)

Then we added the username and password to the machine.config file so that the application runs under the account that we specified, and not with the ASPNET account

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

Hope this helps someone!

+2
source

Source: https://habr.com/ru/post/1739299/


All Articles