简体   繁体   中英

Building wsp from post-build event command line

What is the command for building WSP from post-build event command line?

在此处输入图片说明

I'm adding one more image so that you can understand my exact requirement.

在此处输入图片说明

You can build a WSP by using MSBuild. Each SharePoint project is build with the parameter

IsPackaging=True

By adding this parameter to the msbuild command you can ensure that all WSPs will be created.

I found the answer from here and it works for both SharePoint 2007 and 2010.

call "C:\\Program Files\\WSPTools\\WSPBuilderExtensions\\WSPBuilder.exe" -ProjectPath $(SolutionDir) -OutputPath $(SolutionDir) -SolutionPath $(SolutionDir)

To force Visual Studio to create a wsp on post build for SharePoint solutions, add these properties to the project xml. If you already have a post build event defined, just add the two inner tags to the existing property group. Visual Studio will create the wsp in the configured location; Release or Debug.

To edit the project xml unload the project in visual studio then right-click on the project and select edit.

<PropertyGroup>
      <IsDebugging>False</IsDebugging>
 <PostBuildEventDependsOn>$(PostBuildEventDependsOn);CreatePackage</PostBuildEventDependsOn>
</PropertyGroup>

This seems to be VS2010.
If you choose the project template to be a SharePoint 2010 project then you will find items in the context menu that are related to SharePoint. If you choose deploy, it will create the wsp package automatically and deploy it to the server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM