Skip to content

Unable to create a 'DbContext' of type 'MyIntIdentityContext' #29

@diegooliveirafarias

Description

@diegooliveirafarias

Describe the bug
When executing the command "╰$ dotnet ef migrations add addauth --verbose --context MyIntIdentityContext --project Core.Infra.Postgres --startup-project Api
"I'm getting the error

Cannot create a 'DbContext' of type 'MyIntIdentityContext'. Exception 'Unable to resolve service for type 'Microsoft.EntityFrameworkCore.DbContextOptions`1[Core.Infra.Postgres.EFContext.MyIntIdentityContext]' when trying to activate 'Core.Infra.Postgres.EFContext.MyIntIdentityContext'.' was thrown when trying to create an instance

I'm using .net 8

MyIntIdentityContext

image

CustomIdentityAndKeyConfig

image

Project Structure

image

MyIntIdentityContext

image

Expected behavior
I hope you can help me understand why when executing the command to create the migration I receive an error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions