Condividi tramite


Use the SharePoint project service

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

The SharePoint project system includes a project service that you can use to perform tasks related to the project system. The project service is an ISharePointProjectService object.

You can access the SharePoint project service in any SharePoint tools extension. You can also access it in other types of Visual Studio extensions, such as add-ins and VSPackages. For more information, see How to: Retrieve the SharePoint project service.

Project service features

The following table lists the tasks that you can perform by using the SharePoint project service and the ISharePointProjectService method or property to use to perform each task.

Task Member to use
Access any SharePoint project that is open in Visual Studio. Projects property.
Access all of the SharePoint project item types that are available (including built-in and custom project item types). ProjectItemTypes property.
Access all of the deployment steps that are available to SharePoint projects (including built-in and custom deployment steps). DeploymentSteps property.
Access events that are raised when a developer refactors code in a SharePoint project. CodeRefactoringEvents property.
Execute a custom SharePoint command that calls into the SharePoint server object model. For more information about SharePoint commands, see Call into the SharePoint object models. SharePointConnection property.
Convert a type in the SharePoint project system to a type in the Visual Studio automation object model or integration object model, and vice versa. For more information, see Convert between SharePoint project system types and other Visual Studio project types. Convert method.
Write messages to the Output window or Error List window in Visual Studio. Logger property.
Access other services that are available in Visual Studio. ServiceProvider property.
Retrieve the path to the installation folder of the local SharePoint site that is used for debugging the solution. SharePointInstallPath property.
Determine whether Microsoft SharePoint Server or Microsoft SharePoint Foundation is installed on the computer. IsSharePointInstalled property.
Validate a feature or package in a SharePoint solution. PackageValidationProvider property.

See also