title | description | ms.date | ms.topic | dev_langs | helpviewer_keywords | author | ms.author | manager | ms.subservice | |||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Create SharePoint solution package using MSBuild tasks |
Learn how to build, clean, and validate a SharePoint solution package (.wsp) using command-line MSBuild tasks on a development computer. |
02/02/2017 |
how-to |
|
|
John-Hart |
johnhart |
mijacobs |
sharepoint-development |
You can build, clean, and validate a SharePoint package (.wsp) using command-line MSBuild tasks on a development computer. You can also use these commands to automate the build process by using Team Foundation Server on a build computer.
-
On the Windows Start menu, choose All Programs > Accessories > Command Prompt.
-
Change to the directory where your SharePoint project is located.
-
Enter the following command to create a package for the project. Replace ProjectFileName with the name of the project.
msbuild /t:Package ProjectFileName
For example, you could run one of the following commands to package a SharePoint project called ListDefinition1.
msbuild /t:Package ListDefinition1.vbproj msbuild /t:Package ListDefinition1.csproj
-
Open a command prompt window.
-
Change to the directory where your SharePoint project is located.
-
Enter the following command to clean a package for the project. Replace ProjectFileName with the name of the project.
msbuild /t:CleanPackage ProjectFileName
For example, you could run one of the following commands to clean a SharePoint project called ListDefinition1.
msbuild /t:CleanPackage ListDefinition1.vbproj msbuild /t:CleanPackage ListDefinition1.csproj
-
Open a command prompt window.
-
Change to the directory where your SharePoint project is located.
-
Enter the following command to validate a package for the project. Replace ProjectFileName with the name of the project.
msbuild /t:ValidatePackage ProjectFileName
For example, you could run one of the following commands to validate a SharePoint project called ListDefinition1.
msbuild /t:ValidatePackage ListDefinition1.vbproj msbuild /t:ValidatePackage ListDefinition1.csproj
-
Open a command prompt window.
-
Change to the directory where your SharePoint project is located.
-
Enter the following command to set a property in a package for the project. Replace PropertyName with the property that you want to set.
msbuild /property:PropertyName=Value
For example, you could run the following command to set the warning level.
msbuild /property:WarningLevel = 2