Page 1 of 1

MagickNet type initializer throws exception

Posted: 2013-05-03T12:13:24-07:00
by TerryL
Hi:

I have downloaded Magick.Net.dll and Magick.Net.Web.dll v 6.8.3.10. As the site requests, I have installed VC++ Redistributable for VS2012 X86.

I have created an ASP.NET web application and added references to the above 2 dlls.

The following code blows up on the second line:

Code: Select all

MagickNET.Initialize(@"C:\...");    // this line is OK
MagickImage img = new MagickImage();
The error is "The type initializer for 'ImageMagick.MagickImage' threw an exception."

it does not matter if i insert an image file path in the constructor call. I've tried .NET 4, .NET 4.5.

I'm using VS2012 on a 64-bit Windows 7 system.

I must be missing something really fundamental. Can someone help me out?

Thanks in advance,

Terry

Re: MagickNet type initializer throws exception

Posted: 2013-05-03T13:14:38-07:00
by magick
We did not write, nor do we support MagickNet. Contact the MagickNet developers.

Re: MagickNet type initializer throws exception

Posted: 2013-05-04T15:46:22-07:00
by dlemstra
Are you sure you have placed all the files from the ImageMagick sub directory in the zip file you download in the directory that you specify when calling MagickNET.Initialize(@"C:\...");. I tested it on my machine my removing all the CORE_RL_/IM_MOD_RL_.dll and .xml files from that directory an i got the same exception. Did you check if the Initialize method returned true? It will return false when the environment variable PATH could not be changed.

If you need more help you could leave a message at: https://magick.codeplex.com/discussions or contact me trough codeplex.

Re: MagickNet type initializer throws exception

Posted: 2013-05-17T13:41:12-07:00
by TerryL
That was indeed my problem. Thanks for your help! :D