I was getting this error (SuperChrono is the name of my solution, not StarWars) when trying to run the ef migrations command in .Data directory:
> dotnet ef migrations add Initial -o .\EntityFramework\Migrations
Unable to create an object of type 'SuperChronoContext'. Add an implementation of 'IDesignTimeDbContextFactory' to the project, or see https://go.microsoft.com/fwlink/?linkid=851728 for additional patterns supported at design time.
I found a solution to specify the -s|--startup-project option pointing to your .Api directory:
> dotnet ef migrations add Initial -o .\EntityFramework\Migrations -s ..\SuperChrono.Api
The EF Core tools version '2.1.1-rtm-30846' is older than that of the runtime '2.1.2-rtm-30932'. Update the tools for the latest features and bug fixes.
Done. To undo this action, use 'ef migrations remove'
I was getting this error (
SuperChrono
is the name of my solution, notStarWars
) when trying to run the ef migrations command in.Data
directory:I found a solution to specify the
-s|--startup-project
option pointing to your.Api
directory:Hope this helps someone!