Answered by:
Error while publishing a workflow

Question
-
Hi,
I built a workflow that calls a custom workflow. When i try to publish it, i get an error.
In the trace log, the error is:
Stack Trace Info: [ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index]
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.ThrowHelper.ThrowArgumentOutOfRangeException()
at System.Collections.Generic.List`1.get_Item(Int32 index)
at Microsoft.Crm.Workflow.WorkflowDefinitionVisitor.Visit(CustomActivityStep isvActivityStep)
at Microsoft.Crm.Workflow.ObjectModel.CustomActivityStep.Apply(StepVisitorBase visitor)
at Microsoft.Crm.Workflow.WorkflowDefinitionVisitor.Visit(WorkflowStep workflowStep)
at Microsoft.Crm.ObjectModel.WorkflowServiceInternal`1.CreateDefinitionFromObjectModel(ExecutionContext context, WorkflowEntity definition, List`1 dependencies, List`1 customActivityIds)
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.comp__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)
So what could be the cause of that error?
Thank youThursday, December 10, 2009 2:40 PM
Answers
-
Hi Sabine,
My guess is that the issue is related to the custom workflow activity. Is it a complex activity? If you remove the custom workflow activity, does it publish ok?
Alex Fagundes - www.PowerObjects.com- Marked as answer by Jim Glass Jr Tuesday, February 23, 2010 6:16 PM
Tuesday, December 15, 2009 1:46 PM
All replies
-
Hi,
Here's the list I'd use to try to debug this:
0. Have you tried iisreset and restarting the ms async service?
1. do you have one of the latest ur installed such as ur 6 or 7?
2. are you an administrator in crm and owner of the workflow?
3. if the workflow is sending any emails - readd any entries in the to or from on the email?
4. Does the workflow use plugin workflow extensions? If so, see if the error is related to the plugin
Alex Fagundes - www.PowerObjects.comThursday, December 10, 2009 7:09 PM -
Hi Alex,
Thanks for your reply.
0. I did iisreset and restarting ms asyn service --> no result
1. I have update rollup 4 installed but i don't think this is the cause because it has been there for a long time and i've been publishing lot of kinds of wfs with no problem at all
2. i am admin and owner of the workflow
3. I am not sending any emails from the workflow
4. The workflow calls a custom workflow activity
Any idea what this could be causing the error?Friday, December 11, 2009 6:30 AM -
Hi Sabine,
My guess is that the issue is related to the custom workflow activity. Is it a complex activity? If you remove the custom workflow activity, does it publish ok?
Alex Fagundes - www.PowerObjects.com- Marked as answer by Jim Glass Jr Tuesday, February 23, 2010 6:16 PM
Tuesday, December 15, 2009 1:46 PM -
I have a equal error hearWednesday, September 4, 2013 5:59 PM