Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entity Framework Migrations Error using Visual Studio 2013

I am getting an error running Entity Framework migrations after updating to Visual Studio 2013.

    PM> update-database
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.Shell, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.VisualStudio.Shell, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetProjectTypes(Project project)
   at System.Data.Entity.Migrations.Extensions.ProjectExtensions.IsWebSiteProject(Project project)
   at System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetTargetDir(Project project)
   at System.Data.Entity.Migrations.MigrationsDomainCommand.GetFacade(String configurationTypeName)
   at System.Data.Entity.Migrations.UpdateDatabaseCommand.<>c__DisplayClass2.<.ctor>b__0()
   at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)

Anybody know how to get around this?

like image 957
aBetterGamer Avatar asked Nov 03 '13 01:11

aBetterGamer


2 Answers

I was able to fix this using the Microsoft Visual Studio 2012 Shell (Isolated) Redistributable Package. After I installed the package update-database worked correctly.

PM> update-database
Specify the '-Verbose' flag to view the SQL statements being applied to the target database.
No pending code-based migrations.
Running Seed method.
like image 77
aBetterGamer Avatar answered Sep 21 '22 04:09

aBetterGamer


Update from EF 5 to EF >6, it works!

like image 22
Oscar Acevedo Avatar answered Sep 19 '22 04:09

Oscar Acevedo