Shahed
Shahed

Reputation: 898

How can I create a Sharepoint package (*.wsp) from command line

I have a number of SharePoint web part projects in a single solution. To deploy a web part, I am using the "Publish..." option from solution explorer in visual studio. Then use the stsadm.exe to deploy them on SharePoint server.

enter image description here

Is it possible to generate a *.wsp package from the command line?

Upvotes: 6

Views: 7400

Answers (1)

Yevgeniy.Chernobrivets
Yevgeniy.Chernobrivets

Reputation: 3194

You can use msbuild tool to generate wsp packages.

Below you can find example of cmd script:

set msbuild="C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe"
set config=Release
set outdir2=C:\out\
rd /S /Q "%outdir2%"
%msbuild% /p:Configuration=%config% /m "C:\Test\test.csproj" /t:Package /p:BasePackagePath=%outdir2%
for /F "tokens=*" %%i in ('dir /B /S "%outdir2%"') do if not %%~xi == .wsp del %%i

Upvotes: 8

Related Questions