Neil Fenwick

@neil-fenwick.bsky.social

Software engineer, tech enthusiast, gamer, geek. Works with .NET & C#, loves Go. Also likes to run, a lot.

Ran into this issue today - DelegatingHandlers in #dotnet use a different scope than the request in which they are running. You can get around it by using IHttpContextAccessor as @andrewlock.bsky.social shows here: andrewlock.net/understandin... This needs to be better documented.

DI scopes in IHttpClientFactory message handlers don't work like you think they do

In this post I discuss how handler DI scopes work in IHttpClientFactory, and how they're different to the request DI scope.

andrewlock.net