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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: PluginType [Mittermair.Crm.Plugins.Global.TranslationsEntries.GenerateTranslationEntryKey] not found in PluginAssembly [Mittermair.Crm.Plugins.Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6bf394c4cd0c94ae] which has a total of [0] plugin/workflow activity types. Detail: <OrganizationServiceFault xmlns="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <ActivityId>2d095d2f-94fb-4098-93fb-f34dd4c2e62e</ActivityId> <ErrorCode>-2147204725</ErrorCode> <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic"> <KeyValuePairOfstringanyType> <a:key>ApiExceptionSourceKey</a:key> <a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">Plugin/Microsoft.Crm.ObjectModel.PluginTypeService</a:value> </KeyValuePairOfstringanyType> <KeyValuePairOfstringanyType> <a:key>ApiOriginalExceptionKey</a:key> <a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">Microsoft.Crm.CrmException: PluginType [Mittermair.Crm.Plugins.Global.TranslationsEntries.GenerateTranslationEntryKey] not found in PluginAssembly [Mittermair.Crm.Plugins.Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6bf394c4cd0c94ae] which has a total of [0] plugin/workflow activity types. ---> Microsoft.Crm.CrmException: PluginType [Mittermair.Crm.Plugins.Global.TranslationsEntries.GenerateTranslationEntryKey] not found in PluginAssembly [Mittermair.Crm.Plugins.Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6bf394c4cd0c94ae] which has a total of [0] plugin/workflow activity types. at Microsoft.Crm.CrmPluginAssemblyMetadata.GetPluginTypeMetadata(String typeName) at Microsoft.Crm.ObjectModel.PluginTypeServiceInternal`1.SetIsWorkFlowActivityAttribute(PluginType pluginTypeArg, IBusinessEntity PluginAssembly, SandboxCustomActivityInfo& customActivityInfo, CrmPluginTypeMetadata& typeMetadata, ExecutionContext Context) at Microsoft.Crm.ObjectModel.PluginTypeServiceInternal`1.Create(IBusinessEntity entity, ExecutionContext context) --- End of inner exception stack trace --- at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context) at Microsoft.Crm.Extensibility.PipelineInstrumentationHelper.Execute(Boolean instrumentationEnabled, String stopwatchName, ExecuteWithInstrumentation action, PipelineExecutionContext context) at Microsoft.Crm.Extensibility.Pipeline.<>c__DisplayClass6_0.<RunStep>b__0()</a:value> </KeyValuePairOfstringanyType> <KeyValuePairOfstringanyType> <a:key>ApiStepKey</a:key> <a:value i:type="b:guid" xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/">3dcabb1b-ea3e-db11-86a7-000a3a5473e8</a:value> </KeyValuePairOfstringanyType> <KeyValuePairOfstringanyType> <a:key>ApiDepthKey</a:key> <a:value i:type="b:int" xmlns:b="http://www.w3.org/2001/XMLSchema">1</a:value> </KeyValuePairOfstringanyType> <KeyValuePairOfstringanyType> <a:key>ApiActivityIdKey</a:key> <a:value i:type="b:guid" xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/">2d095d2f-94fb-4098-93fb-f34dd4c2e62e</a:value> </KeyValuePairOfstringanyType> <KeyValuePairOfstringanyType> <a:key>ApiPluginSolutionNameKey</a:key> <a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">System</a:value> </KeyValuePairOfstringanyType> <KeyValuePairOfstringanyType> <a:key>ApiStepSolutionNameKey</a:key> <a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">System</a:value> </KeyValuePairOfstringanyType> <KeyValuePairOfstringanyType> <a:key>ApiExceptionCategory</a:key> <a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">ClientError</a:value> </KeyValuePairOfstringanyType> <KeyValuePairOfstringanyType> <a:key>ApiExceptionMesageName</a:key> <a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">InvalidPluginAssemblyContent</a:value> </KeyValuePairOfstringanyType> <KeyValuePairOfstringanyType> <a:key>ApiExceptionHttpStatusCode</a:key> <a:value i:type="b:int" xmlns:b="http://www.w3.org/2001/XMLSchema">400</a:value> </KeyValuePairOfstringanyType> </ErrorDetails> <HelpLink>http://go.microsoft.com/fwlink/?LinkID=398563&error=Microsoft.Crm.CrmException%3a8004418b&client=platform</HelpLink> <Message>PluginType [Mittermair.Crm.Plugins.Global.TranslationsEntries.GenerateTranslationEntryKey] not found in PluginAssembly [Mittermair.Crm.Plugins.Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6bf394c4cd0c94ae] which has a total of [0] plugin/workflow activity types.</Message> <Timestamp>2021-01-27T11:26:01.4209842Z</Timestamp> <ExceptionRetriable>false</ExceptionRetriable> <ExceptionSource i:nil="true" /> <InnerFault> <ActivityId>2d095d2f-94fb-4098-93fb-f34dd4c2e62e</ActivityId> <ErrorCode>-2147204725</ErrorCode> <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" /> <HelpLink i:nil="true" /> <Message>PluginType [Mittermair.Crm.Plugins.Global.TranslationsEntries.GenerateTranslationEntryKey] not found in PluginAssembly [Mittermair.Crm.Plugins.Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6bf394c4cd0c94ae] which has a total of [0] plugin/workflow activity types.</Message> <Timestamp>2021-01-27T11:26:01.4209842Z</Timestamp> <ExceptionRetriable>false</ExceptionRetriable> <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.RegisterPlugin(CrmOrganization org, CrmPlugin plugin) at Microsoft.Crm.Tools.AssemblyRegistration.PluginRegistrationViewModel.btnregisterClick() |
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.
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.