EF Core Migration error: "Unable to create an object of type 'ApplicationContext'"

asp.net-core entity-framework-core

Question

I'm trying to do the migration with EF Core but I get an error - how can I fix this error?

PM> add-migration ini

Unable to create an object of type 'ApplicationContext'. Add an implementation of 'IDesignTimeDbContextFactory' to the project, or see https://go.microsoft.com/fwlink/?linkid=851728 for additional patterns supported at design time.

1
6
7/14/2018 9:47:55 PM

Popular Answer

This will also happen if you have multiple start-up projects - when migrating, just select one (in VS right click Solution and Set StartUp Projects...)

5
9/8/2018 4:33:13 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow