Condividi tramite


Build and debug SharePoint solutions

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

In general, building and debugging SharePoint solutions is the same as building and debugging other types of projects in Visual Studio. The topics in this section explain the differences that do exist.

Project output for SharePoint solutions

Building SharePoint solutions creates assemblies and a solution package (.wsp) file. The following table shows the locations of these files during a build.

Build item Output folder
Assembly, program database (.pdb), and .wsp files. <ProjectName>\bin\debug or <ProjectName>\bin\release
SharePoint project item files. <ProjectName>\pkg\debug or <ProjectName>\pkg\release
Build intermediate files. <ProjectName>\obj\debug or <ProjectName>\obj\release
Package intermediate files. <ProjectName>\pkgobj\debug or <ProjectName>\pkgobj\release

Build SharePoint solutions

To build SharePoint solutions, the development computer must have the correct version of SharePoint server installed. Otherwise, building SharePoint solutions is the same as building other types of projects in Visual Studio. For more information, see How to: Build SharePoint solutions.

Debug and test SharePoint solutions

Before debugging, Visual Studio copies the .wsp package to the SharePoint server, activates the Site and Web-scoped Features, and in some cases, starts the project. In other cases, you may have to open the project manually. For more information, see Troubleshoot SharePoint solutions and Debug SharePoint solutions.

Debug and verify SharePoint solutions by using Azure DevOps Services features

Azure DevOps Services features such as unit testing and IntelliTrace enable you to more accurately pinpoint problems in your SharePoint solutions. Profiling enables you to locate and identify performance problem areas in your SharePoint solutions. For more information, see Verifying and Debugging SharePoint Code and Profiling the Performance of SharePoint Applications.

Security during the build process

To package or deploy SharePoint solutions, Visual Studio must have permission to copy files to the SharePoint server. You must run Visual Studio as an elevated process, and your user account must be a Site Collections Administrator on the SharePoint server. In addition, you must specify whether your project is a sandboxed solution or a farm solution. For more information, see Differences Between Sandboxed and Farm Solutions.

Using the Clean command

When a SharePoint solution is installed on a SharePoint server for debugging, the Clean command does not uninstall the solution. Instead, you must deactivate the Features through the SharePoint configuration.

See also