Add Migration gives "Unable to resolve project from ..."

entity-framework-core visual-studio-2015

Question

Using EF7 on an ASP.NET 5 project I tried to add a migration typing the following on VS Package Manager Console:

dnx ef migrations add InitialDatabaseSetup

And I got the error:

Unable to resolve project from C:\Projects\ASPNET5DEMO

The project is inside C:\Projects\ASPNET5DEMO\src\aspnet5demo.web

If use Developer Command Prompt to navigate to that path and then run the command then everything works fine ...

Is there a way to use Package Manager Console?

Accepted Answer

Package Manager Console is just a powershell host. If you type pwd you'll see that it's current directory is C:\Projects\ASPNET5DEMO.

Then you can access the relevant command by using;

dnx -p src\aspnet5demo.web ef migrations add InitialDatabaseSetup

or

cd src\aspnet5demo.web
dnx ef migrations add InitialDatabaseSetup


Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why