Closed RedBlack closed 4 years ago
Hi @RedBlack
I'm sorry I noticed this issue just now. I think the problem is you need to support .NET Core 2.2 at least. Could you try that in case you still want to resolve it?
Hi @uhaciogullari
No worries, i have tried the suggested but it did not fix the issue. We have worked around this ourselves by creating our own HttpClientFactory implementation.
Was it the namespace issue like you mentioned?
Yes, the namespace was the issue. We also implemented the Microsoft IHttpClientFactory interface rather then our own separate one. This did mean we lost the .Register() method that you had added but it was not a big issue for us.
Hello @RedBlack and @uhaciogullari
We have this exact problem! Is there a fix for this without creating our own HttpClientFactory implementation?
Thank you!
I changed the root namespace. Pull the latest version and add this using statement.
using HttpClientFactoryLite;
Cheers
Describe the bug
I have an Azure Functions V2 - ASP.Net Core 2.1 project that creates a class in a .Net Standard project which uses HttpClientFactoryLite to create a new HttpClientFactory and it throws the following exception:
Could not load type 'Microsoft.Extensions.Http.HttpClientFactory' from assembly 'Microsoft.Extensions.Http, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
To Reproduce
Steps to reproduce the behavior:
namespace FunctionApp1 { public static class Function1 { [FunctionName("Function1")] public static void Run([TimerTrigger("/15 ")]TimerInfo myTimer, ILogger log) { log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");
}