13

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

Robin Rodricks
  • 110,798
  • 141
  • 398
  • 607

3 Answers3

37

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.

Community
  • 1
  • 1
Robin Rodricks
  • 110,798
  • 141
  • 398
  • 607
  • +1 Thank you for reading the documentation for me, because apparently I can't do that. The only thing I'll add is that you need the VC 2008 runtime if your Magick.NET app targets .NET 2 or 3.5. – Jay Riggs Nov 06 '14 at 23:28
  • 7
    @JayRiggs - If you are trying to say "RTFM", then all I have to say is, which developer on earth would read the documentation for a LIBRARY to solve an app crash that appears to come from the FRAMEWORK? "Could not load file or assembly.." in no way implies "This library is missing a dependency. Please RTFM to know which." Also, which developer assumes that a light "wrapper" library would require an additional system component that the internal library does not? And lastly, even if you DID read the f'ing manual, you would read the ImageMagick manual, not the 3-page Magick.NET docs. – Robin Rodricks Sep 20 '15 at 16:07
  • @Geotarget both your VC2012 and VC2015 links point to the same place – Matt Nov 16 '15 at 16:36
  • The correct link for the VC 2015 runtime is https://www.microsoft.com/en-us/download/details.aspx?id=48145 – Matt Baker Nov 17 '15 at 12:45
  • I was getting this even after installing the VC 2015 runtime. I installed 2012 for good measure and now it works. – Matt Baker Nov 17 '15 at 12:49
  • 1
    @MattBaker - Thanks. Updated post to reflect. – Robin Rodricks Dec 02 '15 at 07:20
  • 1
    @HarshGupta Have your issue is resolved, I am also facing same issue. Could you guide me. – Nachiappan R Nov 29 '16 at 02:07
  • I had to install what you recommended and do this: https://stackoverflow.com/a/39711520/1325179. Then I restarted the application pool. – user1325179 Oct 10 '17 at 21:18
7

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

0

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

OammieR
  • 2,800
  • 5
  • 30
  • 51