Fabe
Fabe

Reputation: 1205

Visual Studio 2015 and Entity Framework Migrations not working

We are using Visual Studio 2015 Update 1 and Entity Framework 6.1.3. Also we are following the Code-First approach and are using Entity Framework Migrations to respond to schema changes. Since updating to Visual Studio 2015, some fellow developers can not add any Entity Framework Migrations. When executing 'Add-Migration', Entity Framework does not find any migrations in the project and asks you to turn on migrations.

Anyone experienced a similar issue and knows a solutions? Many thanks in advance!

Upvotes: 0

Views: 681

Answers (1)

Fabe
Fabe

Reputation: 1205

We were able to determine the root cause and fix the issues.

Issues:

  • Avoid having more than one classes derived from DbContext in an assembly
  • We used the Nu-Get package EntityFrameworkWithHierarchyId, which is not just an extension, but a fork of the Entity Framework. When we replaced all dependencies to EntityFramework by EntityFrameworkWithHierarchyId, the issue disappeared. It properly occured by different install routines in the provided PowerShell Scripts and the different Assemlblies

Upvotes: 1

Related Questions