An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
Hi @Pablo The Tiger ,
Thanks for reaching out.
The issue you’re seeing happens because EF Core needs both the project where your DbContext lives and the project that contains your app configuration. In your solution:
-
Infrastructure-> contains DbContext -
Web-> contains connection string and services
If EF Core tries to use Infrastructure as the Startup Project, it can’t find Web.dll, which causes the error.
Try running this instead:
Add-Migration InitialCreate -Project Infrastructure -StartupProject Web
This tells EF Core:
- DbContext is in Infrastructure
- Startup Project is Web (so it can read the connection string)
Then run:
Update-Database -Project Infrastructure -StartupProject Web
Hope this helps! If my answer was helpful - kindly follow the instructions here so others with the same problem can benefit as well.