Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Make sure IHttpContextAccessor is always registered #728

@dotnetjunkie

Description

@dotnetjunkie

The IHttpContextAccessor allows access to the current executing HttpContext and seems to be a core component of ASP.NET. Still however, the IHttpContextAccessor is not registered by default by ASP.NET while it IMO definitely should.

The whole idea behind the new configuration model in ASP.NET is that everything is registered for you magically behind the covers, but even if you call AddMvc or even AddMvcCore the IHttpContextAccessor isn't registered, while there are many integration scenarios that require its availability. This means that 3rd parties (or possibly even future framework components) always need to check its availability and throw an exception when it's not registered and application developers always need to register it manually.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions