No project was found, change the current working directory or use the --project option


Hi, I'm adding a new class in my asp.net core 2 project and this class is mapped to one of the table in database, I want to use migrations to create the table from my model,
 So I was running this command as shown below in the image:

migrations_error-min.png

but it shows error "No project was found. Change the current working directory or use the --project option".what should i do to resolve this error?

Thanks.


Asked by:- LuneAgile
0
: 910 At:- 12/17/2018 11:04:19 AM
ASP.NET ASP.NET-Core-2 EF-Migrations-error






2 Answers
profileImage Answered by:- vikas_jk

Looks like you are not pointing to current directory, if it's correct, try to change the directory using console

PM> cd E:\Projects\YourProject\
PM> dotnet ef migrations add InitialMigration

If that doesn't work, try using Entity framework Core preview version

"tools": {
      "Microsoft.EntityFrameworkCore.Tools.DotNet": {
      "version": "1.0.0-preview3-final"
  }},

instead of

"tools": {
    "Microsoft.EntityFrameworkCore.Tools.DotNet":"1.0.0"
  },

take a look at this link

https://entityframeworkcore.com/knowledge-base/42991736/ef-core-error---no-project-was-found--change-the-current-working-directory-or-use-the---project-option

It shows similar issue which this solution.

1
At:- 12/18/2018 2:23:46 PM


profileImage Answered by:- LuneAgile

Thanks vikas_jk.

0
At:- 12/19/2018 8:39:26 PM
Which solution worked for you from the above two? can you let me know? thanks 0
By : vikas_jk - at :- 12/21/2018 11:40:57 AM





Login/Register to answer
Or
Register directly by posting answer/details

Full Name *

Email *




By posting your answer you agree on privacy policy & terms of use