戰地連結︰ Home My Flickr NBA.com About

2008年5月10日星期六

Development/Deployment Steps of Workflow in MOSS 2007 and WSS 3.0

Overview

Both MOSS 2007 & WSS 3.0 supports workflow features. However, the steps in developing and deploying workflow in them are quite different. This is because two different types of Visual Studio Project templates are provided for MOSS 2007 and WSS 3.0 separately.

According to my experience, MOSS 2007 can use both types in development and deployment, yet WSS 3.0 can only use "SharePoint Services Workflow Template" in deployment, using "SharePoint Server Workflow Template" will result in error.

Typical Error:
"System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Office.Workflow.Feature, assembly 'Microsoft.Office.Workflow.Feature"

Development Environment

IDE: Visual Studio 2005 (VSTS)
Others:
MOSS SDK v1.2 (For MOSS 2007)
VS extension for WSS (For WSS 3.0)
VS extension for Workflow

MOSS 2007

Development

  1. In Visual Studio, "New" => "Project"
  2. Expand "Visual C#" section, select "Share Point Server (Sequential / State Machine) Workflow Template"
  3. Develop Workflow, Forms (Association, Initiation, Modification or Task Form), and coding.

Deployment

  1. Setup "feature.xml", "workflow.xml"
  2. Open "PostBuildActions.bat" inside "DeploymentFIles" and modify it according to instructions inside the .bat file.
  3. Right-click on Project Name in "Solution Explorer" and select "Properties"
  4. Select "Build Events" tab, at "Post-build event command line", change parameter UNDEPLOY to DEPLOY
  5. Build / Re-build the project
  6. Done!

WSS 3.0

Development

  1. In Visual Studio, "New" => "Project"
  2. Expand "Visual C#" section, select "Share Point Services (Sequential / State Machine) Workflow Template"
  3. Develop Workflow, Forms (Association, Initiation, Modification or Task Form), and coding.

Deployment

  1. Setup "feature.xml", "workflow.xml"
  2. Open "Install.bat" and modify it according to instructions inside the .bat file.
  3. Build / Re-build the project
  4. In Command Prompt, navigate to your project folder. Run "Install.bat"
  5. Done!

Solution for WSS 3.0 'Microsoft.Office.Workflow.Feature NOT FOUND' Deployment Error

Warning: This is only a small workaround when you develop the whole WSS 3.0 workflow based on MOSS 2007 Project Template and get error in deployment. This is not guarantee to work and the workflow might not run even after it is activated in WSS 3.0. Always use "SharePoint Services Workflow Template" for WSS 3.0 Projects.

To workaround this error is simple, just open the "feature.xml" of your workflow project in Visual Studio and delete the two lines beginning with "ReceiverAssembly=...." and "ReceiverClass=.....". After that, try re-build your project and you're done!

Reference

WSS 3.0 - Microsoft.Office.Workflow.Feature file not found??

沒有留言: