Is there an existing issue for this?
Describe the bug
Adding health checks with AddHealthChecks().AddCheck() prevents calls to IHealthCheckPublisher.PublishAsync.
Expected Behavior
I expect IHealthCheckPublisher.PublishAsync to be called where .AddCheck has been called or not.
Steps To Reproduce
https://github.com/anvilcloud/HealthChecksRepro
Exceptions (if any)
None.
.NET Version
7.0.100
Anything else?
IDE
Microsoft Visual Studio Professional 2022 (64-bit) - Current
Version 17.4.2
dotnet --info
.NET SDK:
Version: 7.0.100
Commit: e12b7af219
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19044
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\7.0.100\
Host:
Version: 7.0.0
Architecture: x64
Commit: d099f075e4
.NET SDKs installed:
7.0.100 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.31 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.31 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.31 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
Update: This works if the TargetFramework is set to net7.0. Unfortunately I need to do this in net6.0.
Is there an existing issue for this?
Describe the bug
Adding health checks with AddHealthChecks().AddCheck() prevents calls to
IHealthCheckPublisher.PublishAsync.Expected Behavior
I expect
IHealthCheckPublisher.PublishAsyncto be called where.AddCheckhas been called or not.Steps To Reproduce
https://github.com/anvilcloud/HealthChecksRepro
Exceptions (if any)
None.
.NET Version
7.0.100
Anything else?
IDE
Microsoft Visual Studio Professional 2022 (64-bit) - Current
Version 17.4.2
dotnet --info
Update: This works if the
TargetFrameworkis set tonet7.0. Unfortunately I need to do this innet6.0.