Generic AddHttpClient selected instead of non-generic #16422
Labels
Area-Compiler-Checking
Type checking, attributes and all aspects of logic checking
Feature Improvement
Needs-More information
Milestone
I try to use Named HttpClient as described in the documentation from a Giraffe application.
Together with:
This does not work since the F#-compiler chooses another overload to be used, the generic one.
Here is a small application that illustrates the problem: https://github.com/aklefdal/FSharpNamedHttpClient
This issue is possibly related to
There is a workaround, and that is to add HttpClient as a generic argument to the call to AddHttpClient. This is not documented, nor do I know if it works in all cases. I don't even know why it works.
Update:
There is a second workaround, and that is explicitly to cast the second argument to
Action<HttpClient>
.The text was updated successfully, but these errors were encountered: