I have custom workflow assembly in Crm 4.0 Roll-up 14, this has about 10 activitys in it, Everytime I change it I get an unknknown error and it cannot be updated. This also causes a NullRerferenceException when trying to browse to the Workflow Designer in Crm.
The strange thing is, it only happens to this assembly, and if I remove it and re-add it from scratch it works fine.
This is the error that I get...
Unhandled Exception: System.Web.Services.Protocols.SoapException: Server was unable to process request. Detail:
0x80040216
An unexpected error occurred. Platform at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at PluginRegistrationTool.CrmSdk.CrmService.Create(BusinessEntity entity) at PluginRegistrationTool.RegistrationHelper.RegisterPluginType(CrmOrganization org, CrmPlugin plugin) at PluginRegistrationTool.PluginRegistrationForm.btnRegister_Click(Object sender, EventArgs e)
And when I enable tracing I get the below errors, has anyone got an idea where to go from here?
Sorry for this big dump of trace logs...
Could not Retrieve referenced attributes when expecting single attribute for object id: {45D0F927-5258-E111-AD6A-000C2954073E} [2012-02-29 08:45:50.1] Process: w3wp |Organization:a9ae572d-fabe-4c6c-9a39-8d8882462a55 |Thread: 21 |Category: Platform |User: d6ef60ac-4638-de11-ba36-000f1f66b919 |Level: Error | MessageProcessor.Execute at MessageProcessor.Execute(PipelineExecutionContext context) at InternalMessageDispatcher.Execute(PipelineExecutionContext context) at ExternalMessageDispatcher.Execute(String messageName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, PropertyBag fields, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId) at CrmServiceInternal.Create(String namespaceName, BusinessEntityBase entity, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId) at CrmService.Create(BusinessEntity entity) at RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at LogicalMethodInfo.Invoke(Object target, Object[] values) at WebServiceHandler.Invoke() at WebServiceHandler.CoreProcessRequest() at SyncSessionlessHandler.ProcessRequest(HttpContext context) at CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) at ApplicationStepManager.ResumeSteps(Exception error) at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) at HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr) at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType)
MessageProcessor fail to process message 'Create' for 'plugintype'. [2012-02-29 08:45:50.2] Process: w3wp |Organization:a9ae572d-fabe-4c6c-9a39-8d8882462a55 |Thread: 21 |Category: Platform.Sdk |User: d6ef60ac-4638-de11-ba36-000f1f66b919 |Level: Error | CompositeSoapExtensionExceptionHandler.Handle at CompositeSoapExtensionExceptionHandler.Handle(Stream to, Stream from, Exception exception) at CrmAuthenticationSoapExtensionBase.ProcessMessage(SoapMessage message) at SoapMessage.RunExtensions(SoapExtension[] extensions, Boolean throwOnException) at SoapServerProtocol.WriteException(Exception e, Stream outputStream) at WebServiceHandler.WriteException(Exception e) at WebServiceHandler.Invoke() at WebServiceHandler.CoreProcessRequest() at SyncSessionlessHandler.ProcessRequest(HttpContext context) at CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) at ApplicationStepManager.ResumeSteps(Exception error) at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) at HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr) at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType) CrmSoapExtension detected non-CrmException - report will be sent to Watson: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Crm.ObjectModel.PluginTypeServiceInternal
1.CheckDuplicateActivityName(String name, ExecutionContext context) at Microsoft.Crm.ObjectModel.PluginTypeServiceInternal
1.ValidateCustomActivity(PluginType entity, ExecutionContext context) at Microsoft.Crm.ObjectModel.PluginTypeServiceInternal`1.Create(IBusinessEntity entity, ExecutionContext context) --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Web.Services.Protocols.LogicalMethodInfo.Invoke(Object target, Object[] values) at Microsoft.Crm.Extensibility.InternalOperationPlugin.Execute(IPluginExecutionContext context) at Microsoft.Crm.Extensibility.PluginStep.Execute(PipelineExecutionContext context) at Microsoft.Crm.Extensibility.Pipeline.Execute(PipelineExecutionContext context) at Microsoft.Crm.Extensibility.MessageProcessor.Execute(PipelineExecutionContext context) at Microsoft.Crm.Extensibility.InternalMessageDispatcher.Execute(PipelineExecutionContext context) at Microsoft.Crm.Extensibility.ExternalMessageDispatcher.Execute(String messageName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, PropertyBag fields, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId) at Microsoft.Crm.Sdk.CrmServiceInternal.Create(String namespaceName, BusinessEntityBase entity, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId) at Microsoft.Crm.Sdk.Crm2007.CrmService.Create(BusinessEntity entity) --- End of inner exception stack trace ---
[2012-02-29 08:46:03.7] Process: w3wp |Organization:a9ae572d-fabe-4c6c-9a39-8d8882462a55 |Thread: 21 |Category: Platform |User: d6ef60ac-4638-de11-ba36-000f1f66b919 |Level: Error | MessageProcessor.Execute at MessageProcessor.Execute(PipelineExecutionContext context) at InternalMessageDispatcher.Execute(PipelineExecutionContext context) at ExternalMessageDispatcher.Execute(String messageName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, PropertyBag fields, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId) at CrmServiceInternal.Create(String namespaceName, BusinessEntityBase entity, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId) at CrmService.Create(BusinessEntity entity) at RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at LogicalMethodInfo.Invoke(Object target, Object[] values) at WebServiceHandler.Invoke() at WebServiceHandler.CoreProcessRequest() at SyncSessionlessHandler.ProcessRequest(HttpContext context) at CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) at ApplicationStepManager.ResumeSteps(Exception error) at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) at HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr) at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType)
MessageProcessor fail to process message 'Create' for 'plugintype'. [2012-02-29 08:46:03.7] Process: w3wp |Organization:a9ae572d-fabe-4c6c-9a39-8d8882462a55 |Thread: 21 |Category: Platform.Sdk |User: d6ef60ac-4638-de11-ba36-000f1f66b919 |Level: Error | CompositeSoapExtensionExceptionHandler.Handle at CompositeSoapExtensionExceptionHandler.Handle(Stream to, Stream from, Exception exception) at CrmAuthenticationSoapExtensionBase.ProcessMessage(SoapMessage message) at SoapMessage.RunExtensions(SoapExtension[] extensions, Boolean throwOnException) at SoapServerProtocol.WriteException(Exception e, Stream outputStream) at WebServiceHandler.WriteException(Exception e) at WebServiceHandler.Invoke() at WebServiceHandler.CoreProcessRequest() at SyncSessionlessHandler.ProcessRequest(HttpContext context) at CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) at ApplicationStepManager.ResumeSteps(Exception error) at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) at HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr) at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType) CrmSoapExtension detected non-CrmException - report will be sent to Watson: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Crm.ObjectModel.PluginTypeServiceInternal
1.CheckDuplicateActivityName(String name, ExecutionContext context) at Microsoft.Crm.ObjectModel.PluginTypeServiceInternal
1.ValidateCustomActivity(PluginType entity, ExecutionContext context) at Microsoft.Crm.ObjectModel.PluginTypeServiceInternal`1.Create(IBusinessEntity entity, ExecutionContext context) --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Web.Services.Protocols.LogicalMethodInfo.Invoke(Object target, Object[] values) at Microsoft.Crm.Extensibility.InternalOperationPlugin.Execute(IPluginExecutionContext context) at Microsoft.Crm.Extensibility.PluginStep.Execute(PipelineExecutionContext context) at Microsoft.Crm.Extensibility.Pipeline.Execute(PipelineExecutionContext context) at Microsoft.Crm.Extensibility.MessageProcessor.Execute(PipelineExecutionContext context) at Microsoft.Crm.Extensibility.InternalMessageDispatcher.Execute(PipelineExecutionContext context) at Microsoft.Crm.Extensibility.ExternalMessageDispatcher.Execute(String messageName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, PropertyBag fields, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId) at Microsoft.Crm.Sdk.CrmServiceInternal.Create(String namespaceName, BusinessEntityBase entity, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId) at Microsoft.Crm.Sdk.Crm2007.CrmService.Create(BusinessEntity entity) --- End of inner exception stack trace ---
The key parts I see in increasing order of detail:
MessageProcessor fail to process message 'Create' for 'plugintype'
Microsoft.Crm.ObjectModel.PluginTypeServiceInternal1.CheckDuplicateActivityName
Could not Retrieve referenced attributes when expecting single attribute for object id: {45D0F927-5258-E111-AD6A-000C2954073E}
So I expect Anwar is correct, this is a duplicate. More specifically, this assembly has a plugin with the same name as an existing plugin. Try to select from the plugin table and look at the names.
select name, * from plugintype
The name field will be the class names in your custom assembly and they cannot be duplicated. You can identify the plugin classes because they inherit from Microsoft.Xrm.Sdk.IPlugin.
User contributions licensed under CC BY-SA 3.0