Aspnetcore.docs: Is this up to date with ASP.NET Core 3.0?

Created on 3 Nov 2019  Â·  6Comments  Â·  Source: dotnet/AspNetCore.Docs

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

https://github.com/aspnet/AspNetCore.Docs/blob/f0e7d8e39f902c184da54a04c57f74dcf48162d5/aspnetcore/host-and-deploy/health-checks/samples/3.x/HealthChecksSample/SampleApp.csproj#L8-L13


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

P1 Source - Docs.ms doc-bug

All 6 comments

~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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AnthonyMastrean picture AnthonyMastrean  Â·  3Comments

sonichanxiao picture sonichanxiao  Â·  3Comments

YeyoCoder picture YeyoCoder  Â·  3Comments

cocowalla picture cocowalla  Â·  3Comments

danroth27 picture danroth27  Â·  3Comments