ca9163d9
ca9163d9

Reputation: 29179

How to downgrade Entity framework from 6 to 5?

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 the Entity Framework 6 of the created project to EF5?

Upvotes: 32

Views: 37187

Answers (6)

apinostomberry
apinostomberry

Reputation: 177

for downgrading, you should see an option in nuget package manager under the installed tab for Microsoft.EntityFrameworkCore.SqlServer. click on that and the details menu directly to the right should match the version you are on. From there you can click the drop down menu and select a prior version.

here is the regular terminal version for ef core for your tool if you need it for some reason. It should be backwards compatable though

dotnet tool uninstall dotnet-ef -g

dotnet tool install dotnet-ef --version X.Y.Z -g

Upvotes: 0

Ghebrehiywet
Ghebrehiywet

Reputation: 934

on Package Manager Console write

PM> Uninstall-package EntityFramework

PM> Install-Package EntityFramework -version 5.0.0

Upvotes: -2

Kezza
Kezza

Reputation: 746

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

Upvotes: 0

default
default

Reputation: 11635

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.

Upvotes: 2

undefined
undefined

Reputation: 34269

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

Uninstall-package EntityFramework
Install-Package EntityFramework -version 5.0.0

Upvotes: 61

Jay Traband
Jay Traband

Reputation: 17052

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

Upvotes: 1

Related Questions