3

I've done the upgrade for Visual Studio 2015 Update 3, One project is using ASP.Net Core but only for front end JS and CSS using gulp etc. I've just tried to run migrations on the project with migrations and get the following:

Update-Database is obsolete. Use Apply-Migration instead.
Using project 'ProjectName'
Build started...
Build succeeded.
Using start-up project 'MyProject'.
Using application base 'pathlocation'.
Using application configuration 'pathlocation'\Web.config'
Using data directory ''pathlocation'\App_Data'
Using assembly 'My.dll'.
Exception calling "CreateInstanceAndUnwrap" with "8" argument(s): "Could not load file or assembly 'EntityFramework.Commands' or one of its dependencies. The system cannot find the file specified."

I can't see that I've upgraded to EF 7, and I've uninstalled and reinstalled EF 6 in the project. Any suggestions as to what I'm missing?

LightningShield
  • 680
  • 3
  • 13

2 Answers2

3

I'm sure this was something to do with .Net Core messing up the tooling. To resolve I ran VS as admin. Removed all the EF 7 references in the packages.config in the .Net Core project. Then uninstalled and reinstalled EF 6 through Package Manager Console:

Uninstall-Package EntityFramework -Force
Install-Package EntityFramework -Pre
LightningShield
  • 680
  • 3
  • 13
0

Using EntityFramework 7? Did you set your dnvm?

first you have to run from the cmd of your project folder this command:

dnvm upgrade

Then try again to use migration, but only from the cmd, and using the dnx command.

Example:

"dnx ef migrations add Initial"

more info: here

Community
  • 1
  • 1
Dudi
  • 3,069
  • 1
  • 27
  • 23