Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

HealthCheckServiceCollectionExtensions.AddHealthChecks Method

Definition

Namespace:
Microsoft.Extensions.DependencyInjection
Assembly:
Microsoft.Extensions.Diagnostics.HealthChecks.dll
Package:
Microsoft.Extensions.Diagnostics.HealthChecks v11.0.0-preview.5.26302.115
Source:
HealthCheckServiceCollectionExtensions.cs
Source:
HealthCheckServiceCollectionExtensions.cs
Source:
HealthCheckServiceCollectionExtensions.cs
Source:
HealthCheckServiceCollectionExtensions.cs
Source:
HealthCheckServiceCollectionExtensions.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.

Adds the HealthCheckService to the container, using the provided delegate to register health checks.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHealthChecksBuilder ^ AddHealthChecks(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddHealthChecks(this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member AddHealthChecks : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder
<Extension()>
Public Function AddHealthChecks (services As IServiceCollection) As IHealthChecksBuilder

Parameters

Returns

An instance of IHealthChecksBuilder from which health checks can be registered.

Remarks

This operation is idempotent - multiple invocations will still only result in a single HealthCheckService instance in the IServiceCollection. It can be invoked multiple times in order to get access to the IHealthChecksBuilder in multiple places.

Applies to


Feedback

Was this page helpful?