ServiceManager.GetRequiredService<ServiceType> Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Retrieves the requested service.

Namespace:  System.Activities.Design
Assembly:  System.Activities.Design.Base (in System.Activities.Design.Base.dll)

Syntax

'Declaration
Public Function GetRequiredService(Of ServiceType) As ServiceType
'Usage
Dim instance As ServiceManager
Dim returnValue As ServiceType

returnValue = instance.GetRequiredService()
public ServiceType GetRequiredService<ServiceType>()
public:
generic<typename ServiceType>
ServiceType GetRequiredService()
JScript does not support generic types or methods.
member GetRequiredService : unit -> 'ServiceType 

Type Parameters

  • ServiceType

Return Value

Type: ServiceType
Returns a generic type, which is an instance of the service.

Exceptions

Exception Condition
NotSupportedException

There is no service of the given type.

Remarks

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

.NET Framework Security

Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Framework

Supported in: 4

See Also

Reference

ServiceManager Class

ServiceManager Members

System.Activities.Design Namespace