How to create a SharePoint 2010 package using the command line?

I have a Visual Studio 2010 SharePoint project. If I select Package in the project menu, a .wsp file is created. How can I call the same assembly from the command line (i.e. What / target is required for MSBuild)?

+5
source share
4 answers

I did it finally. The hard part is that the SharePoint targets do not exist, when MSBuild uploads the file .sln, you need to upload separate files .csproj.

set msbuild="C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"
set config=Debug
set outdir="C:\out\"
%msbuild% /p:Configuration=%config% /m ../My.SharePoint.Project/My.SharePoint.Projectcsproj /t:Package /p:BasePackagePath=%outdir%
+4
source

This is also a useful document here: http://msdn.microsoft.com/en-us/ff622991.aspx

" TFS 2010, /p: IsPackaging = True MSBuild"

+3

msbuild :

  • "BuildAndPackage"

    <Target Name="BuildAndPackage">
      <CallTarget Targets="Build"/>
      <CallTarget Targets="Package"/>
    </Target>
    
  • :

    <Project ToolsVersion="4.0" DefaultTargets="BuildAndPackage">
    

, TFS.

+1
source

Set MSBuild verbosity to "maximum" and you should see what is called from the build console.

In VS2010, of course :)

0
source

All Articles