Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
ServiceProvider.DisposeAsync Method
Definition
- Namespace:
- Microsoft.Extensions.DependencyInjection
- Assembly:
- Microsoft.Extensions.DependencyInjection.dll
- Package:
- Microsoft.Extensions.DependencyInjection v11.0.0-preview.5.26302.115
- Source:
- ServiceProvider.cs
- Source:
- ServiceProvider.cs
- Source:
- ServiceProvider.cs
- Source:
- ServiceProvider.cs
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.
Asynchronously disposes the service provider and all resolved services that implement IDisposable or IAsyncDisposable.
public:
virtual System::Threading::Tasks::ValueTask DisposeAsync();
public System.Threading.Tasks.ValueTask DisposeAsync();
abstract member DisposeAsync : unit -> System.Threading.Tasks.ValueTask
override this.DisposeAsync : unit -> System.Threading.Tasks.ValueTask
Public Function DisposeAsync () As ValueTask
Returns
A value task that represents the asynchronous operation.
Implements
Remarks
Awaiting individual DisposeAsync() calls uses ConfigureAwait(false), so when an asynchronous dispose operation yields, its continuations do not attempt to resume on the original synchronization context. Services should not rely on disposal continuations running on any particular context.
Applies to
Feedback
Was this page helpful?
