I've got a rather complex MS CRM plugin project which consists of a LOT of smaller DLLs (including some external references not natively available in CRM).
I usually combine all those DLLs into one using ILmerge. However, recently, this tool has become a hassle - it's slow and can lock up. As such, I wanted to move away from ILmerge and try something else. The first thing I've tried is ILrepack.
This works, and I can create a new DLL. Attempting to load the packaged DLL into the Plugin Registration Tool WORKS - the tools recognizes the package and shows the plugin classes inside.
The problem arises when I actually try to register the plugin. In this case, the operation fails, and I get the following error:
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Unable to load plug-in assembly. Detail: <OrganizationServiceFault xmlns="schemas.microsoft.com/.../Contracts" xmlns:i="www.w3.org/.../XMLSchema-instance"> <ActivityId>016ed764-1a13-4d0f-b9cd-a513efa225cd</ActivityId> <ErrorCode>-2147204719</ErrorCode> <ErrorDetails xmlns:a="schemas.datacontract.org/.../System.Collections.Generic" /> <Message>Unable to load plug-in assembly.</Message> <Timestamp>2017-06-18T18:13:13.4100645Z</Timestamp> <ExceptionSource i:nil="true" /> <InnerFault> <ActivityId>016ed764-1a13-4d0f-b9cd-a513efa225cd</ActivityId> <ErrorCode>-2147204719</ErrorCode> <ErrorDetails xmlns:a="schemas.datacontract.org/.../System.Collections.Generic" /> <Message>Unable to load plug-in assembly.</Message> <Timestamp>2017-06-18T18:13:13.4100645Z</Timestamp> <ExceptionSource i:nil="true" /> <InnerFault i:nil="true" /> <OriginalException i:nil="true" /> <TraceText i:nil="true" /> </InnerFault> <OriginalException i:nil="true" /> <TraceText i:nil="true" /> </OrganizationServiceFault> Server stack trace: at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at Microsoft.Crm.Tools.Libraries.RegistrationHelper.UpdateAssembly(CrmOrganization org, String pathToAssembly, CrmPluginAssembly assembly, PluginType[] type) at Microsoft.Crm.Tools.AssemblyRegistration.PluginRegistrationViewModel.btnregisterClick()
Obviously, this error comes from CRM itself. However, I don't know what to do now. I suspect it's some kind of missing dependency of some sort. However, I was unable to pinpoint the issue using Fusion Logs, and I'm drawing a blank.
What can I do to debug this problem?
*This post is locked for comments