Using Visual Studio I have created a package for SharePoint 2010 that deploys a Workflow that creates Tasks of a custom Content Type Id. When I first deployed it, I noticed that Tasks were being created but they were of the type Workflow Task instead of my custom Task. I fixed it by manually updating the Task list to include my new Content Type.

As part of the deployment (for development purposes), the Workflow is automatically associated with an existing Document Library. In addition, the Workflow is configured to use the existing Task List.

My question is this -- How can I automatically add my custom Content Type to whatever Task list the workflow is configured to use when it gets associated with a given list? What about removing the Content Type when the workflow is disassociated?

I noticed that because I have a workflow association form, there is code that checks if the task list and history list exist, and creates them if necessary. Should I just add code there? Is this something that falls under event receivers? (Not sure what the association form since it does not get called when the workflow is being removed...)

1 Answer 1


Unfortunately there does not seem to be a way. There is no event to hook into when a workflow is associated/disassociated with a list. My solution at this point, for making development easier, was to write a PowerShell script that will create the association and add the content types and then another script that undid that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.