Wednesday, September 21, 2011

How to deploy SharePoint 2010 workflow

Once you are done with testing your workflow on test server you would probably need to deploy this workflow to bring it alive :)

First easy way (which wasn't work for me) is to create wsp package:

  • After you built your project, you can right click on the project in Visual Studio and choose Package option
  • Find wsp file in debug folder of your project (usually C:\Users\user1\Documents\Visual Studio 2010\Projects\MyWorflow\MyWorkflow\bin\Debug). If you want to you can rename MyWorflow.wsp to MyWorkflow.cab and look what VS did for you :)
  • Upload a new solution - Open solution gallery in browser (Site Actions->Site Settings->Under Galleries section choose Solutions) and upload wsp file you have just created. Do not forget activate solution.
  • By now you should see a new feature in Site collection features, but before adding workflow to your list you should check if a new assembly is installed otherwise workflow would be codeless :). You can find it here C:\Windows\assembly\. If the assembly file contain your dll everything is right. If there is not and if you are administrator you can drag and drop dll into assembly file or use gacutil to install dll.
  • Now you can add a new workflow to your list and you should see your workflow name in "Select a workflow template" box. In this point this technique stops work for me
Second way which saves me is little bit more complicated but not too much :)

Till now I don't know why the first method didn't work, but I have tried it with event receiver and it worked fine. Anyway is nice to know that SharePoint offers more than just one way to deploy solutions.
If anyone has experience with this do not hesitate to comment it ;)

No comments:

Post a Comment