To help others (and to remember howto fix the issue), here is a problem that I had.
I am developping some nocode Workflows, and when It was the time to unpublish it using the tools provided by the SDK, I had an unhandled exception.
Why? The stack trace below is detailing that when it's time to unpublish, the registered step are updated to remove the references on the dependencies. The problem is that when uploading the workflows, the steps were not created with empty attributes, so, when it was the time to update them, the row in the SdkMessageProcessingStepImageBase where returned with a null field, instead of an empty field. I have done an update on the database (yeah, it's a test environment, and, anyway, the nocode workflows are not supported for this version).
Now, to avoid that, what's the solution?
I think it's a symptom of the unsupported portion. Maybe it's a check that the import is not doing, and that's a side effect... so there is no solutions. I tried to redeploy (after unpublishing and deleting the workflow), and it was working...
-f.
Error: Exception of type 'System.Web.HttpUnhandledException' was thrown.
Error Message: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Error Details: Exception of type 'System.Web.HttpUnhandledException' was thrown.
Source File: Not available
Line Number: Not available
Request URL: http://theserver/theorg/_grid/cmds/dlg_deactivate.aspx?iObjType=4703&iTotal=1&iIndex=0&iStateCode=-1&iStatusCode=1&iId={5D8DFD50-41A6-4D5C-BF2D-779711A3AE17}
Stack Trace Info: [NullReferenceException: Object reference not set to an instance of an object.]
at Microsoft.Crm.ObjectModel.WorkflowServiceInternal`1.UpdateSdkStepImages(String preImageEntityAttributes, String postImageEntityAttributes, Guid SdkMessageProcessingStepId, ExecutionContext context)
at Microsoft.Crm.ObjectModel.WorkflowServiceInternal`1.CheckRemoveWorkflowExpansionStep(Guid activationId, Int32 primaryEntityTypeCode, ExecutionContext context)
at Microsoft.Crm.ObjectModel.WorkflowServiceInternal`1.Unpublish(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.DeactivateDialogPage.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.vmnet__grid_cmds_dlg_deactivate_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)