-
-
Notifications
You must be signed in to change notification settings - Fork 747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to use refit with HttpClientFactory in .net framework winform application? #1004
Comments
HttpClientFactory is only part of .NET from .NET Core 2.1 and onwards, so .NET 4.x doesn't have it. Refit has full support for HttpClientFactory / DependencyInjection, but doesn't require it. Refit works by making http requests with HttpClient which is part of .NET 4.5, so any version of .NET >= 4.5 is compatible with Refit. It just means you'll need to use the In .NET Core 2.1+ all HttpClientFactory really does is manage the lifecycle of HttpClient objects a bit more intelligently to avoid some problems with HttpClient in older versions of .NET Framework. Does that answer your question? |
Hi |
True. I forgot it's technically netstandard2.0 compatible. The .NET 4.x project I work on isn't really in a position to upgrade to even make use of Getting HttpClientFactory to work in .NET 4.x isn't a Refit specific question, so you might have better luck asking on Stack Overflow for that. On the flipside - does your project actually require the use of HttpClientFactory? It only really helps solve the problems of DNS updates not being respected by HttpClient and socket exhaustion from instantiating too many HttpClients that keep the sockets open for a while after the request completes. I'd imagine in a winforms application this might not be a problem? Anyway, good luck. |
Hi, |
If you have already got If you've gotten |
Hi, |
You could see if Dapplo.Microsoft.Extensions.Hosting.ReactiveUI.WinForms works for you. |
Hi,
I'm not familiar with HttpClientFactory,which appears in asp.net core 2.1 above,Is it possible to use refit with HttpClientFactory in .net framework winform application?
The text was updated successfully, but these errors were encountered: