You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 8, 2018. It is now read-only.
You will get an ArgumentNullException when creating your own HealthCheck handler without setting something to its Name property:
Microsoft.AspNetCore.Server.Kestrel:Error: Connection id "0HLHTL2OE18LU", Request id "0HLHTL2OE18LU:00000002": An unhandled exception was thrown by the application.
System.ArgumentNullException: Value cannot be null.
Parameter name: key
at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
at System.Collections.Generic.Dictionary`2.set_Item(TKey key, TValue value)
at Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckService.CheckHealthAsync(Func`2 predicate, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Diagnostics.HealthChecks.HealthCheckMiddleware.InvokeAsync(HttpContext httpContext)
at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Server.IISIntegration.IISMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
As the exception is not helpful at all, it took me a little while to figure it out (I had to look at the source code).
I believe the solution for this would be:
A specific exception for this
or
The default name is the class full name or whatever
Thanks!
The text was updated successfully, but these errors were encountered:
Hi, @andrecarlucci - as of 2.2.0-preview3 the health check doesn't define its own name, it's passed in (and null-checked) when the check is registered.
Hi guys,
You will get an ArgumentNullException when creating your own HealthCheck handler without setting something to its Name property:
As the exception is not helpful at all, it took me a little while to figure it out (I had to look at the source code).
I believe the solution for this would be:
or
Thanks!
The text was updated successfully, but these errors were encountered: