0
votes

We are in the process of testing an upgrade from our current crm 2011 system to 2016. All our plugins appear to be working as expected without recompilation. All of them have been registered and stored against the database.Both the plugin and workflow assembly, reference a custom library which was built with CRM 2011 sdk references. This library has been deployed to the crm 2016 server. When we run a workflow that executes a custom activity in one of the steps we get the following error:

Could not load file or assembly 'Microsoft.Crm.Workflow, Version=5.0.0.0' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I know the error message indicates that it is dependent on Microsoft.Crm.Workflow version 5 and the current dll available is version 8. What I don't understand it why the plugins execute successfully and the custom workflow activities do not. Do I need to rebuild my plugin assemblies with the new dll references for 2016?

thanks

1
Is it possible your plugin assembly was ILMerged with the SDK dll and your workflow assembly wasn't?Polshgiant
No, we do not use ILMerge at all.noobie

1 Answers

1
votes

The short answer is you most likely just need to recompile (and subsequently re-register) the workflow project against the latest CRM 2016 SDK assembly.

As far as I know there are no compatibility or signature changes with respect to the plugin and workflow execution methods which you are extending. This would explain why you don't get any errors when you register against the new system.

Speculating as to why you are getting the error you are (I can't be sure either is the cause, but perhaps it is):

  • I imagine the 2011 SDK DLL which defines the workflow execution methods you are extending is loading other CRM system DLL's in the background which are either no longer in existence or have been replaced by a newer version which doesn't have the same compatibility. In other words - the signature of the method you are compiling against is the same and is compatible with CRM 2016, however the dependencies of it (which are likely loaded at runtime) are no longer valid.
  • If you are using a library registered in the GAC, if this library is compiled against the 2011 DLL, recompile it against the 2016 version and then re-register it on the server.