Stable Release v5.1.8
This update brings the following changes since the 5.1.7 release:
Added
App Context Switch for Ignoring Server-Provided Failover Partner
What Changed:
- A new app context switch
Switch.Microsoft.Data.SqlClient.IgnoreServerProvidedFailoverPartnerwas introduced to let the client ignore server-provided failover partner info in Basic Availability Groups (BAGs). When the switch is enabled, only the failover partner specified in the connection string is used; server-supplied partner values are skipped. This context switch was introduced in PR #3704.
Who Benefits:
- Applications connecting to SQL Server BAGs using TCP and custom ports, especially where the server's provided partner name lacks the protocol, host, or port. This avoids connection failures when the server-provided partner is incompatible or incomplete.
- Teams who manage availability groups and rely on client-side control of failover behavior in heterogeneous networking environments.
Impact:
- If your environment might be affected (i.e., you operate a BAG with custom ports, or have experienced failures after failover), you can enable the new switch in your application:
AppContext.SetSwitch("Switch.Microsoft.Data.SqlClient.IgnoreServerProvidedFailoverPartner", true);- Then, ensure your connection string includes your preferred failover partner (with correct
tcp:host,port) so that the client uses that instead of the server's suggestion. - Without enabling this, by default, the client continues to prefer the server-provided partner, maintaining backwards compatibility.
Fixed
- Fixed a bulk copy bug that incorrectly prepended a UTF-8 Byte-Order-Marker when processing row data. (#3617)
Changed
- Modernized creation of
Microsoft.Identity.Client.PublicClientApplicationinstances to use its builder pattern. (#3367) - Replaced use of undocumented .NET Framework internals when reading
SqlDecimalvalues. (#3465) - Updated the following dependencies (#3754):
- Azure.Core 1.41.0 (Avoids transitive vulnerability)
- Azure.Identity 1.12.1
- Microsoft.Identity.Client 4.76.0
Target Platform Support
- .NET Framework 4.6.2+ (Windows x86, Windows x64)
- .NET 6.0+ (Windows x86, Windows x64, Windows ARM64, Windows ARM, Linux, macOS)
- .NET Standard 2.0+ (Windows x86, Windows x64, Windows ARM64, Windows ARM, Linux, macOS)
DependenciesExpand commentComment on line R58ResolvedCode has comments. Press enter to view.
.NET Framework
- Azure.Core 1.41.0
- Azure.Identity 1.12.1
- Microsoft.Data.SqlClient.SNI 5.1.2
- Microsoft.Identity.Client 4.76.0
- Microsoft.IdentityModel.JsonWebTokens 6.35.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.35.0
- System.Buffers 4.5.1
- System.Text.Encoding.Web 6.0.1
- System.Text.Json 6.0.11
.NET 6.0
- Azure.Core 1.41.0
- Azure.Identity 1.12.1
- Microsoft.Data.SqlClient.SNI.runtime 5.1.2
- Microsoft.Identity.Client 4.76.0
- Microsoft.IdentityModel.JsonWebTokens 6.35.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.35.0
- Microsoft.SqlServer.Server 1.0.0
- System.Configuration.ConfigurationManager 6.0.1
- System.Diagnostics.DiagnosticSource 6.0.1
- System.Runtime.Caching 6.0.0
- System.Security.Permissions 6.0.0
- System.Security.Principal.Windows 5.0.0
- System.Text.Encoding.CodePages 6.0.0
- System.Text.Encodings.Web 6.0.1
.NET Standard 2.0
- Azure.Core 1.41.0
- Azure.Identity 1.12.1
- Microsoft.Data.SqlClient.SNI.runtime 5.1.2
- Microsoft.Identity.Client 4.76.0
- Microsoft.IdentityModel.JsonWebTokens 6.35.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.35.0
- Microsoft.SqlServer.Server 1.0.0
- Microsoft.Win32.Registry 5.0.0
- System.Buffers 4.5.1
- System.Configuration.ConfigurationManager 6.0.1
- System.Runtime.Caching 6.0.0
- System.Runtime.Loader 4.3.0
- System.Security.Cryptography.Cng 5.0.0
- System.Security.Permissions 6.0.0
- System.Security.Principal.Windows 5.0.0
- System.Text.Encoding.CodePages 6.0.0
- System.Text.Encodings.Web 6.0.1
.NET Standard 2.1
- Azure.Core 1.41.0
- Azure.Identity 1.12.1
- Microsoft.Data.SqlClient.SNI.runtime 5.1.2
- Microsoft.Identity.Client 4.76.0
- Microsoft.IdentityModel.JsonWebTokens 6.35.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.35.0
- Microsoft.SqlServer.Server 1.0.0
- Microsoft.Win32.Registry 5.0.0
- System.Configuration.ConfigurationManager 6.0.1
- System.Runtime.Caching 6.0.0
- System.Runtime.Loader 4.3.0
- System.Security.Cryptography.Cng 5.0.0
- System.Security.Permissions 6.0.0
- System.Security.Principal.Windows 5.0.0
- System.Text.Encoding.CodePages 6.0.0
- System.Text.Encodings.Web 6.0.1