Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can i run the add migration command

I installed the following packages:
Microsoft.EntityFrameworkCore.Design(7.0.2)
Microsoft.EntityFrameworkCore.Sqlite(7.0.2)
and I already installed the Entity Framework. When I tried to run this command:
dotnet ef migrations add InitialMigration I get this error:
No project was found. Change the current working directory or use the –project option.
I alreadt tried go to the project folder using cd "C:…" it doesn’t work.

I described the what i tried so i am going to leave here blank sorry for this because i am very bad question asker at Stack Overflow.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

If you have several projects in one solution or if you have deleted and created a project several times, you may encounter this error (of course, there are other reasons).

This error occurred because Migration could not automatically determine which project to select.

You can solve this problem by adding your project name

dotnet ef migrations add InitialMigration --project TestAPI

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading