I'm building a plugin component for Dynamics CRM 2015. Because we're deploying to CRM Online, the plugin has to be a single signed DLL - we can't deploy additional DLLs alongside it and we can't put anything in the GAC, so I'm using ilmerge.exe to merge and sign my assemblies into a single DLL.
Problem is that, as far as I can see, EasyNetQ/RabbitMQ aren't sending any messages when they're ilmerged. I can reproduce this locally, so it's not a CRM environment issue.
I've got three DLLs
- MyPlugin.dll
- EasyNetQ.dll
- RabbitMQ.Client.dll
If I reference these DLLs separately in my test code and invoke .Execute() on my plugin code, everything works beautifully
I have a post-build step:
$(SolutionDir)packages\ilmerge.2.14.1208\tools\ilmerge.exe /out:$(TargetDir)MyPlugin.Ilmerged.dll /keyfile:$(TargetDir)plugin_key.snk $(TargetDir)EasyNetQ.dll $(TargetDir)RabbitMQ.Client.dll $(TargetDir)MyPlugin.dll
This spits out a single signed DLL, MyPlug.Ilmerged.dll
, that (in theory!) contains EasyNetQ, RabbitMQ and my plugin code. Everything compiles just fine. If I remove the individual DLL references from my test code and add a single reference to this ILMerged assembly, it compiles fine, and the code doesn't throw any exceptions - I just don't get any messages appearing on the queue.
Might this be related to the assembly binding redirect that EasyNetQ is using to resolve RabbitMQ? Or something? I'm completely stumped as to how ILMerge could be causing it to fail silently without actually throwing any errors or anything.