I'm using ImageMagick to convert PDF files to PNG. Running the process from my Web API project locally works as long as I run Visual Studio as admin. When moving the solution to the server the ImageMagick process fails with the following error
convert.exe: unable to load module `C:\Program
specified module could not be found.
The solution to this problem in my situation was to set the environment variable for ImageMagick directly in the code where I was calling the process.
System.Environment.SetEnvironmentVariable("Path", @"C:\Program Files\ImageMagick-6.9.0-Q16");
Apparently even if the environment variable is set on the server, it may not find it due to the runtime being different.