简体   繁体   中英

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!

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM