Efcore: Upgrade to Microsoft.Data.SqlClient v2.1.0

Created on 23 Nov 2020  路  7Comments  路  Source: dotnet/efcore

Currently EF Core 5.0 references v2.0.1 of Microsoft.Data.SqlClient that can cause some issues we recently addressed in v2.1.0:
Release Notes

Most important issues for EF users that were solved with v2.1.0:

and many more bug fixes :)


Please update dependency on Microsoft.Data.SqlCLient to v2.1.0 when appropriate.

area-infrastructure customer-reported type-enhancement

Most helpful comment

@cheenamalhotra Done automatically already for 6.0: https://github.com/dotnet/efcore/pull/23434

We generally don't update to a new point release in a patch, but we will consider it if the issues fixed are significant.

All 7 comments

The short summary is:

  • Ef core 5.0.0 package for sql server is referencing the microsoft sql client nuget version 2.0.1, it needs to reference 2.1.0.
  • The issue can be avoided by manually adding microsoft sql client package 2.1.0 into the project, forcing the ef core sql server package to reference the newer version.
  • But it took me several days to figure this out, hopefully a 5.0.1 hotfix can come out to reference the newer package and save other people lost time.
  • I think only self contained builds are impacted, haven't tested otherwise since I have no use for non-self contained builds at the moment.

@cheenamalhotra Done automatically already for 6.0: https://github.com/dotnet/efcore/pull/23434

We generally don't update to a new point release in a patch, but we will consider it if the issues fixed are significant.

@cheenamalhotra @ajcvickers How about EF Core 3.1? Will it switch to SqlClient 2.x on some point or will those fixes to be ported to SqlClient 1.x?

@olljanat You can just update to use 2.1.0 with EF Core 3.x: https://erikej.github.io/efcore/sqlclient/2020/03/22/update_mds.html

@ErikEJ but are those versions compatible? I assume that there is some breaking change which why version number was raised from 1.x to 2.x?

Yes, no breaking changes for EF Core

Discussed in triage. We will hold off on updating the dependency in 5.0.x for now to allow further feedback on the SqlClient 2.1, since it is newly released. We will then make a call as to whether or not to take this to Tactics.

Was this page helpful?
0 / 5 - 0 ratings