Access denied when using System.Diagnostics.Process

I am trying to use the unmanaged ImageMagick library in my ASP.NET application from the command line using System.Diagnostics.Process. Mostly users upload the .eps file to the site, and then I will run the command line command to convert it to .jpg. This is the code I use to try to execute the command:

Dim proc As New System.Diagnostics.Process proc.StartInfo.RedirectStandardOutput = True proc.StartInfo.RedirectStandardError = True proc.StartInfo.FileName = "C:\Program Files (x86)\ImageMagick-6.6.1-Q16\convert.exe" proc.StartInfo.UseShellExecute = False proc.StartInfo.Arguments = String.Format("{0} {1}", Server.MapPath("~/logo/test.eps"), _ Server.MapPath("~/certificates/temp/test-1234.jpg")) proc.StartInfo.CreateNoWindow = True proc.Start() 

I can just run this code on our Win 2k3 development server, but not on our Windows 2k3 production server. I get the error "System.ComponentModel.Win32Exception: Access Denied." The main thing between the two servers is that the production is 64-bit and runs Plesk to manage multiple domains. I tried to add asp.net user rights to the ImageMagick directory. PS Admin says that in the case of Plesk, this is the same account that I use to access the site in VS using FPE.

Does anyone know what I can do to make this process run on my production server?

Thanks,

Mike

0
source share
1 answer

You need to make sure that the actual identity of the application pool is granted permission to run the application. I believe that plesk creates a specific user for each domain when you install it on the server.

You can check this using IIS Manager to find out which application pool and their identifier.

I assume that you simply do not have the rights granted to the correct user.

+1
source