Are you registering IHttpContextAccessor correctly?