locked
Workflow will not save RRS feed

  • Question

  • After ALOT of reading/research etc... etc... I am finally able to create a Workflow Assembly for CRM 4.0

    This works fine for a brand new project, with a simple test but with this other code I have (which is huge really), I always get an error that there was an error saving the workflow and maybe saving it again will resolve the issue.

    This happens when publishing the workflow. Any ideas?

    This is the exception from the Trace log. 


    [2009-02-18 17:11:53.3] Process: w3wp |Organization:89b330e3-c0c2-4143-aa0d-80dc68dc62d5 |Thread:    9 |Category: Exception |User: 8518f150-0739-4037-b5c8-fff16c5ccca3 |Level: Error | CrmException..ctor
     at CrmException..ctor(String message, Exception innerException, Int32 errorCode, Boolean isFlowControlException, Boolean enableTrace)
     at CrmException..ctor(String message, Int32 errorCode)
     at WorkflowServiceInternal`1.CompileWorkflow(ExecutionContext context, WorkflowEntity definition, List`1 dependencies, List`1 customActivityIds, Guid activationId)
     at WorkflowServiceInternal`1.CompletePublishing(WorkflowEntity definition, List`1 dependencies, List`1 customActivityIds, ExecutionContext context)
     at WorkflowServiceInternal`1.Publish(BusinessEntityMoniker moniker, ExecutionContext context)
     at WorkflowServiceInternal`1.SetState(BusinessEntityMoniker moniker, Int32 newState, Int32 newStatusCode, ExecutionContext context)
     at BusinessProcessObject.SetStateStatus(BusinessEntityMoniker moniker, Int32 newState, Int32 newStatusCode, ExecutionContext context)
     at WorkflowService.Microsoft.Crm.Sdk.IStateful.SetStateStatus(BusinessEntityMoniker , Int32 , Int32 , ExecutionContext )
     at RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
     at RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature 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 InternalOperationPlugin.Execute(IPluginExecutionContext context)
     at PluginStep.Execute(PipelineExecutionContext context)
     at Pipeline.Execute(PipelineExecutionContext context)
     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 RequestBase.Process(Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId)
     at RequestBase.Process(CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId)
     at CrmServiceInternal.Execute(RequestBase request, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId)
     at InProcessCrmService.Execute(Object request)
     at PlatformCommand.ExecuteInternal()
     at SetStateCommand.Execute()
     at ActivateDialogPage.ConfigureForm()
     at AppUIPage.OnPreRender(EventArgs e)
     at Control.PreRenderRecursiveInternal()
     at Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
     at Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
     at Page.ProcessRequest()
     at Page.ProcessRequestWithNoAssert(HttpContext context)
     at Page.ProcessRequest(HttpContext context)
     at sandlerltd__grid_cmds_dlg_activate_aspx.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)
    >Crm Exception: Message: Workflow compilation failed:
    347: CreateInstance failed for type 'DataRecruitAutoskillCVWorkflowAssembly.CVWorkflow'. Exception has been thrown by the target of an invocation.., ErrorCode: -2147201023
    [2009-02-18 17:11:54.0] Process: w3wp |Organization:89b330e3-c0c2-4143-aa0d-80dc68dc62d5 |Thread:    9 |Category: Exception |User: 8518f150-0739-4037-b5c8-fff16c5ccca3 |Level: Error | CrmException..ctor
     at CrmException..ctor(String message, Exception innerException, Int32 errorCode, Boolean isFlowControlException, Boolean enableTrace)
     at CrmException..ctor(String message, Exception innerException, Int32 errorCode)
     at WorkflowServiceInternal`1.CompileWorkflow(ExecutionContext context, WorkflowEntity definition, List`1 dependencies, List`1 customActivityIds, Guid activationId)
     at WorkflowServiceInternal`1.CompletePublishing(WorkflowEntity definition, List`1 dependencies, List`1 customActivityIds, ExecutionContext context)
     at WorkflowServiceInternal`1.Publish(BusinessEntityMoniker moniker, ExecutionContext context)
     at WorkflowServiceInternal`1.SetState(BusinessEntityMoniker moniker, Int32 newState, Int32 newStatusCode, ExecutionContext context)
     at BusinessProcessObject.SetStateStatus(BusinessEntityMoniker moniker, Int32 newState, Int32 newStatusCode, ExecutionContext context)
     at WorkflowService.Microsoft.Crm.Sdk.IStateful.SetStateStatus(BusinessEntityMoniker , Int32 , Int32 , ExecutionContext )
     at RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
     at RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature 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 InternalOperationPlugin.Execute(IPluginExecutionContext context)
     at PluginStep.Execute(PipelineExecutionContext context)
     at Pipeline.Execute(PipelineExecutionContext context)
     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 RequestBase.Process(Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId)
     at RequestBase.Process(CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId)
     at CrmServiceInternal.Execute(RequestBase request, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId)
     at InProcessCrmService.Execute(Object request)
     at PlatformCommand.ExecuteInternal()
     at SetStateCommand.Execute()
     at ActivateDialogPage.ConfigureForm()
     at AppUIPage.OnPreRender(EventArgs e)
     at Control.PreRenderRecursiveInternal()
     at Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
     at Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
     at Page.ProcessRequest()
     at Page.ProcessRequestWithNoAssert(HttpContext context)
     at Page.ProcessRequest(HttpContext context)
     at sandlerltd__grid_cmds_dlg_activate_aspx.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)
    >Crm Exception: Message: Workflow compilation failed:
    347: CreateInstance failed for type 'DataRecruitAutoskillCVWorkflowAssembly.CVWorkflow'. Exception has been thrown by the target of an invocation.., ErrorCode: -2147201023, InnerException: Microsoft.Crm.CrmException: Workflow compilation failed:
    347: CreateInstance failed for type 'DataRecruitAutoskillCVWorkflowAssembly.CVWorkflow'. Exception has been thrown by the target of an invocation..
       at Microsoft.Crm.ObjectModel.WorkflowServiceInternal`1.CompileWorkflow(ExecutionContext context, WorkflowEntity definition, List`1 dependencies, List`1 customActivityIds, Guid activationId)
    [2009-02-18 17:11:54.0] Process: w3wp |Organization:89b330e3-c0c2-4143-aa0d-80dc68dc62d5 |Thread:    9 |Category: Platform |User: 8518f150-0739-4037-b5c8-fff16c5ccca3 |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 RequestBase.Process(Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId)
     at RequestBase.Process(CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId)
     at CrmServiceInternal.Execute(RequestBase request, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId)
     at InProcessCrmService.Execute(Object request)
     at PlatformCommand.ExecuteInternal()
     at SetStateCommand.Execute()
     at ActivateDialogPage.ConfigureForm()
     at AppUIPage.OnPreRender(EventArgs e)
     at Control.PreRenderRecursiveInternal()
     at Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
     at Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
     at Page.ProcessRequest()
     at Page.ProcessRequestWithNoAssert(HttpContext context)
     at Page.ProcessRequest(HttpContext context)
     at sandlerltd__grid_cmds_dlg_activate_aspx.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 'SetStateDynamicEntity' for 'workflow'.
    [2009-02-18 17:11:54.4] Process: w3wp |Organization:89b330e3-c0c2-4143-aa0d-80dc68dc62d5 |Thread:    9 |Category: Application |User: 00000000-0000-0000-0000-000000000000 |Level: Error | ErrorInformation.LogError
     at ErrorInformation.LogError()
     at ErrorInformation..ctor(Exception exception, Uri requestUrl, Boolean logError)
     at ErrorInformation..ctor(Exception exception, Uri requestUrl)
     at MainApplication.Application_Error(Object sender, EventArgs eventArguments)
     at EventHandler.Invoke(Object sender, EventArgs e)
     at HttpApplication.RaiseOnError()
     at HttpApplication.RecordError(Exception error)
     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)
    >MSCRM Error Report:
    --------------------------------------------------------------------------------------------------------
    Error: Exception of type 'System.Web.HttpUnhandledException' was thrown.

    Error Number: 0x80045001

    Error Message: Workflow compilation failed:
    347: CreateInstance failed for type 'DataRecruitAutoskillCVWorkflowAssembly.CVWorkflow'. Exception has been thrown by the target of an invocation..

    Error Details: Workflow compilation failed:
    347: CreateInstance failed for type 'DataRecruitAutoskillCVWorkflowAssembly.CVWorkflow'. Exception has been thrown by the target of an invocation..

    Source File: Not available

    Line Number: Not available

    Request URL: http://technica-test:5555/SandlerLtd/_grid/cmds/dlg_activate.aspx?iObjType=4703&iTotal=1&iIndex=0&iId={48710CF6-179A-4F9A-8E01-A8E9761A56D7}

    Stack Trace Info: [CrmException: Workflow compilation failed:
    347: CreateInstance failed for type 'DataRecruitAutoskillCVWorkflowAssembly.CVWorkflow'. Exception has been thrown by the target of an invocation..]
       at Microsoft.Crm.ObjectModel.WorkflowServiceInternal`1.CompileWorkflow(ExecutionContext context, WorkflowEntity definition, List`1 dependencies, List`1 customActivityIds, Guid activationId)

    [CrmException: Workflow compilation failed:
    347: CreateInstance failed for type 'DataRecruitAutoskillCVWorkflowAssembly.CVWorkflow'. Exception has been thrown by the target of an invocation..]
       at Microsoft.Crm.ObjectModel.WorkflowServiceInternal`1.CompileWorkflow(ExecutionContext context, WorkflowEntity definition, List`1 dependencies, List`1 customActivityIds, Guid activationId)
       at Microsoft.Crm.ObjectModel.WorkflowServiceInternal`1.CompletePublishing(WorkflowEntity definition, List`1 dependencies, List`1 customActivityIds, ExecutionContext context)
       at Microsoft.Crm.ObjectModel.WorkflowServiceInternal`1.Publish(BusinessEntityMoniker moniker, ExecutionContext context)
       at Microsoft.Crm.ObjectModel.WorkflowServiceInternal`1.SetState(BusinessEntityMoniker moniker, Int32 newState, Int32 newStatusCode, ExecutionContext context)
       at Microsoft.Crm.BusinessEntities.BusinessProcessObject.SetStateStatus(BusinessEntityMoniker moniker, Int32 newState, Int32 newStatusCode, ExecutionContext context)
       at Microsoft.Crm.ObjectModel.WorkflowService.Microsoft.Crm.Sdk.IStateful.SetStateStatus(BusinessEntityMoniker , Int32 , Int32 , ExecutionContext )

    [TargetInvocationException: Exception has been thrown by the target of an invocation.]
       at Microsoft.Crm.Application.Utility.Util.RaiseXMLError(Exception exception)
       at Microsoft.Crm.Dialogs.ActivateDialogPage.ConfigureForm()
       at Microsoft.Crm.Application.Controls.AppUIPage.OnPreRender(EventArgs e)
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    [HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown.]
       at System.Web.UI.Page.HandleError(Exception e)
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
       at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
       at System.Web.UI.Page.ProcessRequest()
       at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
       at System.Web.UI.Page.ProcessRequest(HttpContext context)
       at ASP.sandlerltd__grid_cmds_dlg_activate_aspx.ProcessRequest(HttpContext context)
       at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


     

    Any ideas at all? When debugging, it goes through the constructor just fine (empty) and then thats basically it. it seems to exit the assembly correctly but I then get this error in MS CRM 4.0


    Need 2 be back @ MS - MS All the way! Follower since 1995 MS Super Evangelist| MSDN Forums Moderator
    Wednesday, February 18, 2009 5:19 PM

Answers

  • Solution: Place the referenced assembly in the GAC
    Need 2 be back @ MS - MS All the way! Follower since 1995 MS Super Evangelist| MSDN Forums Moderator
    • Marked as answer by ahmedilyas Thursday, February 19, 2009 10:33 AM
    Thursday, February 19, 2009 10:33 AM

All replies

  • Looks like MS CRM doesn't like to load external assemblies?!

    I created a new simple project for a workflow assembly
    I add another plain assembly (.NET) as a reference, and called a method

    then I registered the workflow assembly, and hit the same problem!

    so seems like I cannot use my own "general/generic" assembly as I did with MS CRM 3.0!
    That assembly contains all methods required for my workflow plugins to call/get/do stuff (like a framework assembly)

    is this true? is there a way to make it work so you can call and use external/referenced assemblies when creating a workflow assembly?
    Need 2 be back @ MS - MS All the way! Follower since 1995 MS Super Evangelist| MSDN Forums Moderator
    Wednesday, February 18, 2009 7:50 PM
  • Solution: Place the referenced assembly in the GAC
    Need 2 be back @ MS - MS All the way! Follower since 1995 MS Super Evangelist| MSDN Forums Moderator
    • Marked as answer by ahmedilyas Thursday, February 19, 2009 10:33 AM
    Thursday, February 19, 2009 10:33 AM