-
-
Notifications
You must be signed in to change notification settings - Fork 745
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
[BUG] The 'InnerHandler' property must be null. #1403
Comments
This still seems to be an issue - when using RestService.For - the code works, but when using Dependency Injection (HttpClientFactory) the code fails. |
As @jchannon said, the inner handler should not be set when using from DI or it will fail when building the handlers pipeline |
@Ninja2 should we update the docs to reflect this? It's confusing and then you need separate setups for either RestService.For and DI? |
I can confirm this issue when implementing on Azure Functions.
In case others end here as me ( and the issue isn't closed ;) ) My current workaround is to add a flag in the DelegatingHandler constructor e.g.
Hence for DI (Azure Functions):
For RestService.For (Testing):
|
* Addressing #1403 Co-authored-by: Glenn <5834289+glennawatson@users.noreply.github.com>
I m facing the same issue in a MAUI Blazor App .Net 7.0
and a DelegatingHandler message handler for httpclient request as follow
I m injecting httpsclient as follow
Really the app is working fine but sometimes this issue appears suddenly even sometimes when the app is idle for a while I get this error as follow blazor.webview.js:1 The 'InnerHandler' property must be null. 'DelegatingHandler' instances provided to 'HttpMessageHandlerBuilder' must not be reused or cached. |
any status update here? |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Using the code defined in the README https://github.com/reactiveui/refit#reducing-header-boilerplate-with-delegatinghandlers-authorization-headers-worked-example, running the app results in an exception:
Steps To Reproduce
Expected behavior
My app to run.
I believe you shouldn't set the InnerHandler
Environment
The text was updated successfully, but these errors were encountered: