title: ASP.NET Core - Error trying to use HealthChecks
body: <p>I'm trying to use the .NET Core 2.2 Health Checks.</p>
  
  <p>In <code>ConfigureServices</code> I registered my class that implements the <code>Microsoft.Extensions.Diagnostics.HealthChecks.IHealthCheck</code> interface.</p>
  
  <p>But when I execute the <code>UseHealthChecks</code> extension method inside the <code>Configure</code> method, it throws an error:</p>
  
  <pre><code>public void Configure(IApplicationBuilder app)
  {
      app.UseHealthChecks("/hc"); // &lt;-- Error in this line
      // ...
  </code></pre>
  
  <p><strong>System.InvalidOperationException:</strong> 'Unable to resolve service for type 'Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckService' while attempting to activate 'Microsoft.AspNetCore.Diagnostics.HealthChecks.HealthCheckMiddleware'</p>