c# dotnet ef migrations script can't find project or startup-project in database-first

3k views Asked by At

I cannot run the following in the package manager

dotnet ef migrations script

(even if I try to add --project or --startup-project options) I get error: No project was found. Change the current working directory or use the --project option.

Easy to demonstrate: Visual Studio/ File /New Project. Select .NET Core and Console App (.NET Core).

From Package Manager Console

Install-Package install-package Microsoft.EntityFrameworkCore.SqlServer

Scaffold-DbContext "Server=.;Database=infostar-network;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models

This builds everything: a robust context file and all the cs files for each of the tables. Visual Studio Solution Explorer is on the base of the application (where the csproj file is located).

Solution Explorer / File Manager

I'm lost. Any ideas? Thanks in advance. Chuck (Yogi)

0

There are 0 answers