dotnet / EntityFramework.Docs

Documentation for Entity Framework Core and Entity Framework 6
https://docs.microsoft.com/ef/
Creative Commons Attribution 4.0 International
1.56k stars 1.94k forks source link

Unable to create a 'DbContext' of type ''. The exception 'Unable to resolve service for type 'Microsoft.EntityFrameworkCore.DbContextOptions`1[mywebsite.Data.ApplicationDbContext]' while attempting to activate 'mywebsite.Data.ApplicationDbContext'.' was thrown while attempting to create an instance. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728 #4692

Closed DemozeDan1 closed 1 month ago

DemozeDan1 commented 1 month ago

Type of issue

Typo

Description

[Enter feedback here]

Page URL

https://learn.microsoft.com/en-us/ef/core/cli/dbcontext-creation?tabs=dotnet-core-cli

Content source URL

https://github.com/dotnet/EntityFramework.Docs/blob/main/entity-framework/core/cli/dbcontext-creation.md

Document Version Independent Id

d988e806-cb86-19f5-7f76-6ce3bfcd94ed

Article author

@bricelam

DemozeDan1 commented 1 month ago

how can I resolve this error?

roji commented 1 month ago

This issue is lacking enough information for us to be able to fully understand what is happening. Please attach a small, runnable project or post a small, runnable code listing that reproduces what you are seeing so that we can investigate.

DemozeDan1 commented 1 month ago
Screenshot 2024-03-24 133646
DemozeDan1 commented 1 month ago
Screenshot 2024-03-24 133706
DemozeDan1 commented 1 month ago
Screenshot 2024-03-24 133941
roji commented 1 month ago

@DemozeDan1 I'm sorry, but a couple screenshots do not constitute "a small, runnable code listing". Please put together a minimal program/project that shows the problem.