Development, Dynamics CRM

Registering plugins in CRM with errors

Registering a plugin in CRM may result in an error. In my case, I was registering a new assembly and got an error that the assembly has a total of [0] plugin/workflow activity types.

 

Searching the web lead to the information, that I might have an assembly included, that has a higher .net framework version as supported (this would be .net 4.6.2).
I checked my included libraries and also my ilmerge options, but there were not different framework versions added.

I searched the errorcode -2147204725, which was also displayed in the error message, but there was no helpful information on this.

After some time I recognized, that reinstalling the nuget packages resetted my setting of the referenced libraries. Therefore also the Microsoft-Crm libraries had the setting “Copy Local” set to true. This leads my automatic merging with ilmerge, to include this libraries to my plugin assembly.

Library copy local settings

As the dynamics provides its own sdk assemblies, this lead to an error during registration, as my assembly contains the same library.
Changing the value “Copy Local” to false, rebuilding my assembly and registering again, it succeeded.