How to downgrade Entity framework from 6 to 5?

前端 未结 5 1645
终归单人心
终归单人心 2020-12-28 14:08

I\'m creating a Asp.Net MVC project using VS2013 and added hottowel (2.0.1) using nuget. However, the breeze doesn\'t work with Entity Framework 6.

How to downgrade

相关标签:
5条回答
  • 2020-12-28 14:09

    The Breeze packages marked with "(obsolete)" are intended for use with EF5 and WebApi. The 'current' packages ( those not marked with obsolete) are all intended for WebApi2 and EF6. There is no option currently to mix and match EF5 with WebApi2. If this is important please add this to the Breeze User Voice

    0 讨论(0)
  • 2020-12-28 14:12

    in the nuget package console for your project (select it in the dropdown) type:

    Uninstall-package EntityFramework
    Install-Package EntityFramework -version 5.0.0
    
    0 讨论(0)
  • 2020-12-28 14:22

    Entity Framework also moves the __MigrationHistory table from System Tables to user tables. When I tried to run my application after rollback it wouldn't work, so I had to move the __MigrationHistory back to the system tables with:

    EXEC sys.sp_MS_marksystemobject __MigrationHistory;
    

    When I did upgrade to EntityFramework 6 I had to add an empty migration (unfortunately I do not remember the reason, but I guess it complained about updating the database or similar). I also had to remove that empty migration. Since this was a completely empty migration I guess this is safe to do, I do not know about migrations that actually change the database. However, they might not complain when running the program.

    delete from dbo.__MigrationHistory where MigrationId = 'myEmptyMigration';
    

    Then I deleted the empty migrationfile from my project which resolved my problems.

    0 讨论(0)
  • 2020-12-28 14:26

    on Package Manager Console write

    PM> Uninstall-package EntityFramework

    PM> Install-Package EntityFramework -version 5.0.0

    0 讨论(0)
  • 2020-12-28 14:32

    I realize this is an old post with an Answer already but thought I'd add this little nugget.

    If you have many projects using Entity Framework and want to downgrade all of them, first change one of the projects manually, then refresh the package description page and you will get Consolidate as an Action. Select this, then select version 5.0.0 and this will let you downgrade all projects to 5.0.0

    0 讨论(0)
提交回复
热议问题