Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Solution for error when trying to create migrations #14

Open
Albert221 opened this issue Aug 24, 2018 · 0 comments
Open

Solution for error when trying to create migrations #14

Albert221 opened this issue Aug 24, 2018 · 0 comments

Comments

@Albert221
Copy link

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'

Hope this helps someone!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant