ServiceManager.GetRequiredService<TServiceType> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
A generic type, which is an instance of the service.
Exceptions
There is no service of the given type.
Remarks
Unlike GetService, this method throws a NotSupportedException if the service is not available.
Applies to
Sodelujte z nami v storitvi GitHub
Vir za to vsebino najdete v storitvi GitHub, kjer lahko tudi ustvarite in pregledate težave in zahtevke za uveljavitev sprememb. Če želite več informacij, glejte naš vodnik za sodelavce.