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...)