We are using an older version of Structuremap (3.1.9.463). It's been a while since I used structuremap and HttpClients alongside and I wonter how to properly inject the IHttpClientFactory in structuremap.
Simply using bootStrapper.For<IHttpClientFactory>().Use<HttpClient>();
won't work
A usage example is
public class DialogClient : IDialogClient
{
private readonly HttpClient _client;
public DialogClient(IHttpClientFactory httpClientFactory)
{
_client = httpClientFactory.CreateClient();
_client.BaseAddress = new Uri(ConfigurationManager.AppSettings["Dialog:url"]);
}
}
The project also use .NET Framework, not Core.