Operation is not valid due to the current state of the object PS workflow RRS feed

  • Question

  • Dear All,

    I've a situation here, whenever i create a project that has a custom workflow on it.  It threw an error "Operation is not valid due to the current state of the object"

    Here's stack trace that i managed to get:

       at Microsoft.Office.Project.Server.Workflow.WorkflowHelper.GetService[T](ActivityExecutionContext context)     at Microsoft.Office.Project.Server.Workflow.ProjectSequence.SetInitialStages(ActivityExecutionContext context)     at Microsoft.Office.Project.Server.Workflow.ProjectSequence.Execute(ActivityExecutionContext context)     at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)     at System.Workflow.ComponentModel.CompositeActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)     at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(Activity activity, ActivityExecutionContext executionContext)     at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)     at System.Workflow.Runtime.Scheduler.Run()

    Thanks and Regards,


    Friday, November 30, 2012 4:01 AM

All replies

  • Hi there--

    It's kind of bit complex to find the issue since it requires more details on each activity you are performing via code. I would prefer to debug your code. Please follow Jim's article to start with & find the exceptions from code:

    For sample, Please refer to SDK or below article:

    Good luck.


    If you found this post helpful, please “Vote as Helpful”. If it answered your question, please “Mark as Answer”. Thanks, Amit Khare |EPM Consultant| Blog:

    Friday, November 30, 2012 6:21 AM
  • Hi Amit Khare,

    Sorry for being to direct...

    i had already attached it to Microsoft.Office.Project.Server.* (in all session and all of them), owstimer.exe, w3wp (all of them).  i'd already checked Exceptions to thrown an error(both were checked) before i posted here.  But it didn't break.  The only way i got that stack trace was through Fault handlers which catched System.Exception (added a code activity that send error message to db).

    It was thrown from projectsequence activity.  I knew that because i had disabled all child activity inside projectsequence, and it still didn't run.  But when i disabled it, it ran completely without error.

    The creation process stopped in message Creating PPM Demand Management (PPM Demand Management was my workflow name) with error message Operation still processing.  I checked my workflow through Site workflows -> Show all workflows, there i saw that error message in workflow history

    Thank's and Regards

    Thank's and Regards, Ariwibawa

    Friday, November 30, 2012 6:59 AM