AspNetCore.Diagnostics.HealthChecks
AspNetCore.Diagnostics.HealthChecks copied to clipboard
Multiple health checks are not working.
Multiple health checks are not working:
Initially, multiple health checks are working for 6.0.2 version but it is not working in 8.0.1 version. Please enable multiple health checks since we are using readOnly and readWrite database instances.
Error message:
'Duplicate health checks were registered with the name(s): mysql (Parameter 'registrations')'
Source code:
services.AddHealthChecks()
.AddCheck("self", () => HealthCheckResult.Healthy())
.AddMySql(
readOnlyDbConnectionString,
nameof(DataContext),
tags: new[] { "services" }
)
.AddMySql(
readWriteDbConnectionString,
nameof(ReadOnlyDataContext),
tags: new[] { "services" }
);
Environment:
.NET Core version 8 Healthchecks version 8.0.1 Operative system: Windows