ServiceManager.GetRequiredService ServiceManager.GetRequiredService ServiceManager.GetRequiredService ServiceManager.GetRequiredService Method

Definition

Retrieves the requested service.

public:
generic <typename TServiceType>
 TServiceType GetRequiredService();
public TServiceType GetRequiredService<TServiceType> ();
member this.GetRequiredService : unit -> 'ServiceType
Public Function GetRequiredService(Of TServiceType) () As TServiceType

Type Parameters

TServiceType

The type of service to retrieve.

Returns

TServiceType TServiceType TServiceType TServiceType

A generic type, which is an instance of the service.

Exceptions

Remarks

Unlike GetService, this method throws a NotSupportedException if the service is not available.

Applies to