MagickNet type initializer throws exception

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
TerryL
Posts: 2
Joined: 2013-05-03T11:36:15-07:00
Authentication code: 6789

MagickNet type initializer throws exception

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: MagickNet type initializer throws exception

Post by magick »

We did not write, nor do we support MagickNet. Contact the MagickNet developers.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: MagickNet type initializer throws exception

Post 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.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
TerryL
Posts: 2
Joined: 2013-05-03T11:36:15-07:00
Authentication code: 6789

Re: MagickNet type initializer throws exception

Post by TerryL »

That was indeed my problem. Thanks for your help! :D
Post Reply