Robin Rodricks
Robin Rodricks

Reputation: 114046

Could not load file or assembly 'Magick.NET-x86.DLL' or one of its dependencies

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.)

Upvotes: 13

Views: 17253

Answers (3)

OammieR
OammieR

Reputation: 2860

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

Upvotes: 0

Aleksei Prokopov
Aleksei Prokopov

Reputation: 165

For me one more thing was needed: in IIS Application pool -> advanced settings -> Enable 32-Bit applications

Upvotes: 7

Robin Rodricks
Robin Rodricks

Reputation: 114046

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.

Upvotes: 37

Related Questions