Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateArgumentCallSites(Type serviceType, Type implementationType, CallSiteChain callSiteChain, ParameterInfo[] parameters, bool throwIfCallSiteNotFound)html
As of .NET Core 2.1 there is an extension method that has been added to correctly register an IHttpContextAccessor
as a singleton. See Add helper to register IHttpContextAccessor #947. Simply add as follows in your ConfigureServices()
method:git
services.AddHttpContextAccessor();