问题
I have used Magick.NET which is a .NET wrapper for ImageMagick, and it throws the above error on a client machine. It works fine on my machine though. I have not installed ImageMagick so I simply can't understand what I need to do on a client machine. I have VS 2012 installed.
Also, Magick.NET includes ImageMagick within it, I think it uses C++/CLI and exposes a .NET interface to the native ImageMagick, all within a single DLL. So what DLL does it need?
(I just came across this error so posting the solution I found.)
回答1:
Magick.NET needs the VC 2012 Runtime installed, and Magick.NET V7+ (.NET 4.0) needs 2012 and the VC 2015 Runtime installed. Download and install on client machine. If it pops up a "repair or uninstall" dialog then its already installed and you might be missing another dependency. If not, install VCR and restart your app.
回答2:
For me one more thing was needed: in IIS Application pool -> advanced settings -> Enable 32-Bit applications
回答3:
I have error
System.TypeInitializationException: The type initializer for 'X86' threw an exception. --->
System.DllNotFoundException: Unable to load DLL 'Magick.NET-Q16-x86.Native.dll': Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
Fix by set Application pool -> advanced settings -> Enable 32-Bit = false
来源:https://stackoverflow.com/questions/23308415/could-not-load-file-or-assembly-magick-net-x86-dll-or-one-of-its-dependencies