Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 686
Miguel Moura Avatar asked Mar 13 '23 23:03

Miguel Moura


1 Answers

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
like image 189
Stafford Williams Avatar answered Mar 25 '23 16:03

Stafford Williams