In the Visual Studio 2005 era, Visual Studio Plug-ins provided a batch file (*.bat) for deploying SharePoint workflows; In Visual Studio 2008, Visual Studio supports the direct deployment of SharePoint workflows. Although it is convenient to design, develop, and deploy SharePoint workflows using Visual Studio 2008来, if you want to deploy a well developed workflow to another server, Visual Studio 2008 does not create a workflow as a WSP file. No batch file was provided.
This article describes a way to build a SharePoint workflow wsp file in Visual Studio 2008. Although this method is not a new method, but know very little, so I am still tired to describe it.
To create a SharePoint workflow Solution package
First you need to install Microsoft Visual Studio Tools for the Office System power Tools v1.0.0.0 and download the following addresses:
http://www.microsoft.com/downloads/details.aspx?FamilyID=46B6BF86-E35D-4870-B214-4D7B72B02BF9&displaylang=en
Then open your text editor to open your work item file (*.csproj), navigate to the bottom of the file, and add the following tag above the </Project> tag:
<Target Name="AfterBuild">
<Exec Command=""C:\Program Files\Microsoft VSTO Power Tools 1.0\Workflow Package Generator\WorkflowPackageGen.exe" /featureManifest:feature.xml" ContinueOnError="true">
</Exec>
</Target>
After you save the workflow project with Visual Studio 2008, the workflow is generated, and the resulting WSP files are found in the project folder, and Manifest.xml, PACKAGE.DDF, Setup.inf, and setup.rpt files are included. Very convenient.
The resulting WSP file also contains the resource files referenced by the workflow, including InfoPath form files referenced in feature.xml using the elementfile tag.
Deploying a SharePoint Workflow Solution package
Save the following command to a batch file (*.bat), where you can deploy the WSP file to a SharePoint farm:
@SET STSADM="c:\program files\common files\microsoft shared\web server extensions\12\bin\stsadm.exe"
%STSADM% -o addsolution -filename WSP文件路径