WorkflowRuntime::GetService Method (Type^)
Retrieves a service of the specified Type from the workflow run-time engine.
Assembly: System.Workflow.Runtime (in System.Workflow.Runtime.dll)
Parameters
- serviceType
-
Type:
System::Type^
The Type of the service to retrieve.
Implements
IServiceProvider::GetService(Type^)| Exception | Condition |
|---|---|
| ArgumentNullException | serviceType is a null reference (Nothing in Visual Basic). |
| ObjectDisposedException | The WorkflowRuntime is already disposed of. |
| InvalidOperationException | More than one service of type serviceType was found. |
GetService throws an InvalidOperationException if more than one service exists for the specified Type. Therefore, you should use one of the overloaded methods of GetAllServices if it is possible that multiple services of the specified type are present in the WorkflowRuntime. For example, the workflow run-time engine may have multiple tracking services. If you request a tracking service by specifying the TrackingService base class, it is possible that an exception will be thrown.
Available since 3.0