Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 848
Shahed Avatar asked Feb 12 '14 18:02

Shahed


1 Answers

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
like image 159
Yevgeniy.Chernobrivets Avatar answered Sep 21 '22 12:09

Yevgeniy.Chernobrivets