Tuesday, 5 April 2011

SharePoint 2010 WSP Packaging on TFS Build Server

I thought I'd make a not of this so I remember it. When VS builds a SharePoint 2010 project, it doesn't automatically create a WSP package (it does this on deploy). This is fine in the development environment, but when it comes to using a build server, the WSP must be created on build. I've found 2 ways of doing this.

1. When queuing a build, the following MSBuild arguments can be specified to package the project:


I found the first here:


2. To save doing this everytime a build is made, the following modification can be made the the project file:

<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\SharePointTools\Microsoft.VisualStudio.SharePoint.targets" />


If found the second here:



  1. good article on wsp package it will help you a lot in deployment.

  2. You can just add this to the build definition.

    - Right mouse click on the build defintion
    - Edit
    - Select Process
    - Expand Advanced
    - In MSBuild Arguemnts, add /p:IsPackaging=True
    - Save

    All subsequent builds will automatically generate the WSP.

    I supposed you could do this in the Build Template as well.