Whenever I try to add typed HttpClient
to my application, it goes into an infinite loop until I run out of memory, or I kill the process.
I am using it as follows:
services.AddHttpClient<IHandler, HandlerImplementation>(opt =>
{
opt.BaseAddress = new Uri(configuration.GetSection("endpoints")["remoteService"] ?? string.Empty);
}).AddHttpMessageHandler<AuthenticationDelegatingHandler>();
and the handler looks as follows
public class HandlerImplementation : AbstractHandler, IHandler
{
private readonly HttpClient _httpClient
public HandlerImplementation(HttpClient client, IBaseDependency dependency) : base(dependency)
{
_httpClient = client;
}
}
Is there anything I am doing wrong?
2