WorkflowRuntime::RemoveService Method (Object^)
Removes the specified service from the workflow run-time engine.
Assembly: System.Workflow.Runtime (in System.Workflow.Runtime.dll)
Parameters
- service
-
Type:
System::Object^
An object that represents the service to remove.
| Exception | Condition |
|---|---|
| ArgumentNullException | service is a null reference (Nothing in Visual Basic). |
| ObjectDisposedException | The WorkflowRuntime is already disposed of. |
| InvalidOperationException | The workflow run-time engine has started (IsStarted is true) and service is a core service. - or - service is not registered with the workflow run-time engine. |
You cannot remove a core service while the workflow run-time engine is running (IsStarted is true). Core services are services that derive from the WorkflowSchedulerService class, the WorkflowCommitWorkBatchService class, the WorkflowPersistenceService class, or the TrackingService class. If service derives from the WorkflowRuntimeService class, RemoveService calls the Stop method implemented by service.
In the following example, a SqlWorkflowPersistenceService is added and removed from the WorkflowRuntime.
Available since 3.0