Skip to content

InvalidOperationException “The event receiver context for Workflow is invalid” Problems with onTaskChanged in a SharePoint Workflow

If you’re dropping a onTaskChanged activity and you’re finding an event in the ULS like the following …

11/30/2006 08:56:04.12  OWSTIMER.EXE (0x05D4)                    0x0B48 Windows SharePoint Services    Workflow Infrastructure        72er Medium   System.InvalidOperationException: The event receiver context for Workflow is invalid.     at Microsoft.SharePoint.SPEventReceiverDefinition.ValidContext()     at Microsoft.SharePoint.SPEventReceiverDefinition.ValidReceiverFields()     at Microsoft.SharePoint.SPEventReceiverDefinition.GetSqlCommandToAddEventReceivers(IList`1 erds)     at Microsoft.SharePoint.Workflow.SPWinOESubscriptionService.CommitNewSubscriptions(Transaction txn, IList`1 erds)

Help Your SharePoint User

The problem may no with the event receiver, rather that in the CreateTask activity you didn’t associate properties for TaskID, TaskProperties, or CorrelationToken.  Thus there’s no context for the event to call back to.

No comment yet, add your voice below!

Add a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Share this: