Closed ThomasArdal closed 5 years ago
Thanks for contacting us, @ThomasArdal. @rynowak, all yours to answer.
Yes. We don't register the health checks directly in DI anymore. This turned out to be too limiting in a variety of ways.
Use services.AddHealthChecks().AddCheck<MyHealthCheck>("myname")
if you don't care about lifetimes
or if you do want to enforce a singleton lifetime:
services.AddHealthChecks().AddCheck<MyHealthCheck>("myname");
services.AddSingleton<MyHealthCheck>();
In preview1, I could register health checks like this:
In preview3, my health check is no longer created and executed when requesting the health endpoint. Did something change?