I have a solution with two projects inside Visual Studio Code:
webapi
project called Sample.APIclasslib
project called Sample.Data
In Sample.Data, I have these packages installed:
Microsoft.EntityFrameworkCore.Design
Microsoft.EntityFrameworkCore.SqlServer
Microsoft.EntityFrameworkCore.Tools
After creating a DbContext for a simple model and specifying the connection string, I run into the following error when executing this command (Inside the Sample.Data folder):
dotnet ef migrations add InitialMigration
Startup project 'Sample.Data.csproj' targets framework '.NETStandard'.
There is no runtime associated with this framework, and projects targeting it can't be executed directly.
To use the Entity Framework Core .NET Command-line Tools with this project, add an executable project
targeting .NET Core or .NET Framework that references this project, and set it as the startup project
using --startup-project; or, update this project to cross-target .NET Core or .NET Framework...
If this was Visual Studio, I would set the WebAPI project as the startup project. But I'm using VS Code.
What am I missing?
dotnet ef migrations add InitialMigration --startup-project Sample.API.csproj
? This should set the project as the startup link