Skip to content

Transaction.WebApi Missing registration of HttpContextAccessor #6

@captnjosh

Description

@captnjosh

Am having this exception when Try it out under swagger of GET account/balance:
System.InvalidOperationException: Unable to resolve service for type 'Microsoft.AspNetCore.Http.IHttpContextAccessor' while attempting to activate 'Transaction.WebApi.Services.IdentityService'.

Solution, add this, as it not registered by default anymore:
services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions