Sdílet prostřednictvím


Using and Providing Services

Note

This article applies to Visual Studio 2015. 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

A service is a contract between two VSPackages. One VSPackage offers a specific set of interfaces for another VSPackage to consume. For example, Visual Studio offers the SVsActivityLog service to any VSPackage it loads. This service provides the IVsActivityLog interface, which can be used to write to the activity log. For more information, see How to: Use the Activity Log.

VSPackages can offer services of their own by using the IProfferService interface..

Visual Studio offers important services, such as the following:

IDE service Description
SVsShell Provides access to IDE services dealing with basic functionality, VSPackages, and the registry.
SVsUIShell Provides basic windowing and UI-related functionality in the IDE, such as the ability to create tools and document windows.
SVsSolution Provides basic solution-related functionality, such as the ability to enumerate projects, create new projects, and monitor project changes.

In This Section

Service Essentials
Presents the important elements of a Visual Studio service.

How to: Get a Service
Discusses how to request (consume) a service.

How to: Provide a Service
Discusses how to provide a service.

How to: Provide an Asynchronous Visual Studio Service
Discusses how to provide an asynchronous service.

How to: Troubleshoot Services
Discusses common problems and presents solutions to them.

Visual Studio SDK