In Production Environment : We have Custom Workflows in a Visual studio Project, each time we create a Site based on Site definition we have to reassign workflow association from visual studio. How to avoid this problem ?

In Live Environment : How can we deploy workflows with our Site Definition (list Definition and content types) ?

Any help will be highly appreciated.


1 Answer 1


I would go for:

  1. Make the workflow attach himself to a content type. You could easily do this by adding the Content Type to your solution (deploy via a Site Collection scoped feature - recomanded) and irrelevant of whether you have or not a Site Definition, everywhere where the Content Type gets deployed and used (with the workflow code too of course) it will attached automatically. Here example of declarative connecting them http://howtosharepoint.blogspot.ch/2010/05/custom-workflow-not-available-to-be.html
  2. In the Feature Activated receiver you could programatically attach the workflow to either list, site, etc. depending of course of your workflow intended use. Attaching programatically here http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spcontenttype.workflowassociations.aspx or here http://www.thorntontechnical.com/tech/sharepoint/sharepoint-2010-associate-workflow-to-content-type-in-a-feature

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.