We recommend using Visual Studio 2017
This documentation is archived and is not being maintained.

Package.GetGlobalService Method

Gets a service proffered globally by Visual Studio or one of its packages. This is the same as calling GetService() on an instance of a package that proffers no services itself.

Namespace:  Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell.12.0 (in Microsoft.VisualStudio.Shell.12.0.dll)

public static Object GetGlobalService(
	Type serviceType


Type: Type

The type of the service requested.

Return Value

Type: Object
The service being requested if available, otherwise null.