This project has moved and is read-only. For the latest updates, please go here.

Cannot get it to compile with ILMerge

Jul 19, 2015 at 9:31 AM
I'm using the any cpu version:

Unresolved assembly reference not allowed: Magick.NET.Wrapper-x86.

Trying with the x64 version:

The assembly 'Magick.NET.Wrapper-x64' is not marked as containing only managed code.

I guess that mixing managed/native code with ILMerge is not allowed, but why it is working with GraphicsMagick then? Any idea?
Jul 19, 2015 at 11:14 AM
This has to do with the changes I made to Magick.NET. I am no longer using Fasterflect and moved all the 'architecture dependent' code to a separate library. I am referencing this library in the project but I am not including it in the output. When that assembly is being resolved in your code it will not find it and it will use the embedded assembly. With Fasterflect this was all done with reflection so there was no missing reference.
Jul 19, 2015 at 12:10 PM
All very clear, thanks! And a quick reply too! :P

Just out of curiosity, do you think that using this flag the merge could be achievable?

I decided that it is best to keep it outside my assembly anyway.

And while we're talking, to install an assembly in the GAC it has to be strong named (singed), do you think it feaseable for such a project?
Jul 19, 2015 at 1:03 PM
Edited Jul 19, 2015 at 1:03 PM
I don't think that option will help because you still have the unresolved reference for the AnyCPU build and for the x64 build it will probably not work since the code has non-IL features.

The assemblies of Magick.NET are strong named. I don't need a code singing certificate to do that. It would be nice to have a code singing certificate but I don't want to spend the money.
Jul 19, 2015 at 1:55 PM
Yes, the flag was meant for the arch specifc version.

Ah, so I could already deploy Magick to the GAC! Interesting... would you advise it when having a large number of different projects using the DLL?
Jul 19, 2015 at 3:03 PM
I have never placed an assembly in the GAC and you might want to check this stack overflow question first before you do that:
Jul 19, 2015 at 3:43 PM
Edited Jul 19, 2015 at 3:44 PM
Well, it seems that GAC is not the right place for such a library! :) It's just that the size of ImageMagick is pretty singificant (>12 MB), multiplied for a growing number of sites... mmm I'll see! Thanks again for the support!
Jul 19, 2015 at 3:57 PM
I don't think you should worry about the size of assembly. The files in your customer their site/application probably take up more space that this assembly.