EF Core Error - No project was found. Change the current working directory or use the --project option

前端 未结 6 2025
萌比男神i
萌比男神i 2020-12-28 13:28

I am using Visual Studio 2015 and dotnet core and trying to develop an EF Core Code First project using Sqlite and this documentation / tut

6条回答
  •  渐次进展
    2020-12-28 14:15

    It simply Means that

    YOU ARE NOT IN CURRENT PROJECT DIRECTORY

    I was facing the same issue when scaffolding existing database of MySql using this.

    Command I was executing:

    dotnet ef dbcontext scaffold "Server=123.1.1.1;Uid=abc;Pwd=abc;Database=myDB;Connection Timeout=20;Persist Security Info=False;Port=3306;Allow User Variables=True;Connect Timeout=120;" MySql.Data.EntityFrameworkCore -o Models
    

    Causing the same error , then I checked current working directory inside package manager console and found incorrect.

    In my case

    Mean I was not in current project directory then after switching directory

    cd SSGCApp

    Now you are in project directory all good to run the Command.

提交回复
热议问题