Open utterances-bot opened 1 year ago
Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: [projectname].HttpContext.IHttpContextWarpper Lifetime: Scoped ImplementationType: [projectname].HttpContext.HttpContextWarpper': Unable to resolve service for type 'Microsoft.AspNetCore.Http.HttpContextAccessor' while attempting to activate '[projectname].HttpContext.HttpContextWarpper'.)'
That's weird.
Have you added services.AddHttpContextAccessor();
?
How to access the HttpContext in .NET API | Code4IT
Code4IT - a blog for dotnet developers
https://code4it.dev/blog/inject-httpcontext/