ServiceProvider.GetService Method

Definition

Overloads

GetService(Guid)

Retrieves a service with a specified service GUID.

GetService(Type)

Retrieves a service of the specified type.

GetService(Guid)

Retrieves a service with a specified service GUID.

C++
public:
 virtual System::Object ^ GetService(Guid serviceGuid);

Parameters

serviceGuid
Guid

The GUID of a service.

Returns

The service with the specified service GUID, or null if no service is found.

Applies to

Visual Studio SDK 2022 and other versions
Product Versions
Visual Studio SDK 2017, 2019, 2022

GetService(Type)

Retrieves a service of the specified type.

C++
public:
 virtual System::Object ^ GetService(Type ^ serviceType);

Parameters

serviceType
Type

The service type.

Returns

Returns the service of the specified type, or returns null if no service is found.

Implements

Exceptions

The serviceType parameter is null.

Applies to

Visual Studio SDK 2022 and other versions
Product Versions
Visual Studio SDK 2017, 2019, 2022