How can I build a SharePoint 2010 package using command line?

后端 未结 4 1150
庸人自扰
庸人自扰 2020-12-06 03:11

I have a Visual Studio 2010 SharePoint project. If I choose \'Package\' from the project menu, a .wsp file is generated. How can I invoke the same build from command line (i

4条回答
  •  天涯浪人
    2020-12-06 03:40

    I got it to work, finally. The tricky part is the fact that the SharePoint targets do not exist when MSBuild loads the .sln file, you have to load the individual .csproj files.

    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%
    

提交回复
热议问题