It suggests we:
Add a package reference to the Microsoft.AspNetCore.Diagnostics.HealthChecks package. To perform health checks using Entity Framework Core, add a package reference to the Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore package.
But the sample repo's project file does no such thing? There is no Microsoft.AspNetCore.Diagnostics.HealthChecks reference
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
~Typo ... it should be Microsoft.Extensions.Diagnostics.HealthChecks.~
I'll patch it. Thanks for calling it out.
Well .... it _was_ a thing ...
https://www.nuget.org/packages/Microsoft.AspNetCore.Diagnostics.HealthChecks
... possibly 2.x. I'll take a closer look.
So the deal on this one is that the Microsoft.AspNetCore.Diagnostics.HealthChecks package is in the Microsoft.AspNetCore.App package for 2.2, and it references the Microsoft.Extensions.Diagnostics.HealthChecks package. For 2.x, it should say that if the app doesn't use the App package to place a reference to it.
For 3.x, the package is implicit in the framework.
I'll put an update in now to fix it up.
I also noticed the WriteResponse implementation provided relies on Newtonsoft.Json. Is it appropriate to rewrite this to use System.Text.Json things, since:
As part of the work to improve the ASP.NET Core shared framework, Json.NET has been removed from the ASP.NET Core shared framework.
It wasn't according to engineering at the time of the 3.0 update. I'll keep that in mind for the next doc update, which will be for 3.1. I'll put a note now on the sample tracking issue that we're using.
It wasn't according to engineering at the time of the 3.0 update
Ah yes, you're quite right. The sample works fine in 3.0 currently, which saves me rewriting it (for the minute at least!).
Thanks for making a note, though!