This update brings the following changes since the 7.1.0-preview2 release:
Important — package version alignment: Starting with the 7.0.2 release, the
Microsoft.Data.SqlClientdriver and its companion packages share a single aligned version. Preview 3 of the7.1line continues this alignment; the following packages ship together as7.1.0-preview3:
Microsoft.Data.SqlClientMicrosoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProviderMicrosoft.Data.SqlClient.Extensions.AzureMicrosoft.Data.SqlClient.Extensions.AbstractionsMicrosoft.Data.SqlClient.Internal.Logging(
Microsoft.SqlServer.Servercontinues to version independently and remains at1.0.0.)Applications must reference the same versions of
Microsoft.Data.SqlClientand its extensions for best compatibility. In particular, applications that referenceMicrosoft.Data.SqlClient.Extensions.Azuremust upgrade it to7.1.0-preview3when upgradingMicrosoft.Data.SqlClientto7.1.0-preview3.Compatibility guarantee: All aligned assemblies ship with
FileVersion 7.1.0.xandAssemblyVersion 7.0.0.0. TheAssemblyVersionis unchanged from 7.0.2, so upgrading from7.0.2to7.1.0-preview3does not require any new .NET Framework strong-name binding redirects.
What Changed:
- Added four
virtualasynchronous counterparts to the existing synchronous methods on theSqlColumnEncryptionKeyStoreProviderabstract base class:DecryptColumnEncryptionKeyAsync,EncryptColumnEncryptionKeyAsync,SignColumnMasterKeyMetadataAsync, andVerifyColumnMasterKeyMetadataAsync. Each takes an optionalCancellationToken. The default implementations delegate to the existing synchronous methods, so providers that do not override them continue to work unchanged. (#3672, #3673)
Who Benefits:
- Authors of custom column encryption key store providers — particularly those backed by network-bound key stores such as HSMs or cloud key vaults — can now implement genuinely asynchronous key operations, and callers that resolve column encryption keys directly through a provider can await them instead of blocking a thread on synchronous I/O.
Impact:
- Purely additive. Because the new methods are
virtualwith a synchronous fallback, existing providers compile and run without modification. - Introduced, but not yet consumed by the driver. These APIs are added to the public surface in this release so that provider authors can begin implementing them, but
Microsoft.Data.SqlClientdoes not call them yet — the driver's own column encryption key resolution path (SqlSecurityUtility) still invokes the synchronous provider methods on both the synchronous and asynchronous command paths. Overriding the asynchronous methods therefore does not by itself remove blocking key-store I/O fromExecuteReaderAsyncand friends. A future release will enable their use from the driver's own asynchronous APIs. - The in-box
SqlColumnEncryptionAzureKeyVaultProvideroverrides all four methods in this release. See the AzureKeyVaultProvider 7.1.0-preview3 release notes. (#4540)
What Changed:
- Substantially expanded
ChannelDbConnectionPool, the opt-in pool implementation gated behind theSwitch.Microsoft.Data.SqlClient.UseConnectionPoolV2AppContext switch, bringing it to parity with the defaultWaitHandleDbConnectionPool:- Transaction support — implemented
PutObjectFromTransactedPoolandTransactionEnded(previouslyNotImplementedException), and reworked connection return to mirror the reference pool's deactivate-then-route behavior. (#4487) - Connection replacement — implemented replacement of broken connections during command execution, with atomic slot replacement in
ConnectionPoolSlots. (#4429) - Background warmup and replenishment — the pool now pre-creates connections up to
Min Pool Sizeon startup and replenishes automatically whenever it drops below the minimum. (#4452) - Idle pruning — the pruning window is now derived from the
Connection Idle Timeoutvalue rather than a hard-coded interval. Defaults are unchanged. (#4463) - Connection-creation rate limiting — an optional
ConcurrencyLimitercan throttle new physical connection creation; when a permit is denied the caller waits for an existing connection instead of forcing another open. (#4395, #4396) - Leaked connection reclamation — the pool now reclaims leaked connections (connections whose owning
SqlConnectionwas garbage collected without being closed) both inline on the requesting thread and, while callers are waiting, from a demand-drivenPoolReclaimertimer. Thenumber-of-reclaimed-connectionscounter, which previously always read zero under pool V2, is now emitted. (#4529) - Metrics and tracing parity — the pool now emits the same pooled/free connection and soft/hard connect/disconnect counters as the default pool, and traces at comparable fidelity. (#4504)
- Transaction support — implemented
Who Benefits:
- Applications evaluating the V2 connection pool can now exercise transaction-enlisted workloads, broken-connection recovery, leaked-connection reclamation, and pool warmup, and can observe the pool through the existing performance counters and EventSource traces.
Impact:
- No change to default behavior.
ChannelDbConnectionPoolis used only whenSwitch.Microsoft.Data.SqlClient.UseConnectionPoolV2is enabled; the default pool remainsWaitHandleDbConnectionPool. - This work also surfaced connection pool performance counter defects that affect the default pool, which are listed under Fixed below.
- Windows-only native SNI types are now removed cleanly by the IL trimmer on Linux and macOS, and
LocalAppContextSwitches.UseManagedNetworkingis now substituted for a constant (anILLink.Substitutions.xmlnaming defect previously prevented this). The driver now builds a single OS-agnostic assembly for all platforms; the structure and contents of the NuGet package are unchanged. (#4207, #4239, #4465, #4474) - Reduced managed allocations in the async read path by restoring reuse of
PacketDatalinked-list nodes via a bounded free list onStateSnapshot, recovering an allocation regression against the 6.1.6 baseline. This applies to the default async read path and is not gated behind any AppContext switch;SqlCommand/ExecuteReaderAsyncreturns from +120.9% allocated against the 6.1.6 baseline to +0.1%. (#4536) SqlBulkCopyno longer builds SQL Graph column alias mapping tables when the source and destination tables contain no graph pseudo-columns ($edge_id,$to_id,$from_id,$node_id), recovering a bulk copy performance regression introduced with graph column alias support in #3677. Graph table bulk copy behavior is unchanged. (#4535)- Operations no longer allocate a formatted trace string when
SqlClientEventSourcetracing is disabled, recovering a memory regression against the 6.1.6 baseline. Trace output with tracing enabled is unchanged. (#4528) - Updated centrally managed dependency versions for the
net9.0target framework to9.0.18, and addedSystem.Threading.RateLimitingto the packaged dependency metadata. Non-net9.0targets keep their existing8.0.xpins. (#4507) - Updated the
Microsoft.Data.SqlClient.SNIandMicrosoft.Data.SqlClient.SNI.runtimedependencies to7.1.0-preview3.26226.3. (#4564)
- Fixed Always Encrypted VSM/HGS enclave attestation not verifying that the enclave public key used to establish the session matches the key committed to by the signed attestation report. The provider now compares
SHA-256(enclave public key)against the report'sEnclaveDatausing a fixed-time comparison, and rejects attestation when the data is missing, malformed, or mismatched. (#4532) - Fixed a
SqlConnectionFactorytimer that woke the process every 30 seconds for the lifetime of the application even when no connection pools existed — including withPooling=Falseand afterClearAllPools(). The pruning timer is now armed on demand and disarmed once there is nothing left to prune. A missing .NET Framework unload hook was also added. (#1881, #4479) - Fixed connection pool performance counter defects affecting the default pool as well as pool V2.
active-soft-connectsandnumber-of-active-connectionscould go negative after a failed connection activation, andactive-soft-connects,active-hard-connections, andnumber-of-pooled-connectionsdrifted upward permanently after a broken connection was replaced. Because these are gauges, an unmatched increment or decrement never recovered for the lifetime of the process. (#4504) - Fixed
OverflowExceptionwhen sending largedecimalvalues (for exampledecimal.MaxValue) as a parameter with explicitPrecisionandScale, which primarily affected Always Encrypted scenarios where both must always be set. (#1655, #4443) - Fixed a TDS stream error when passing a
DateOnlyvalue as a parameter withSqlDbType.Variant; the requiredsql_variantwrite paths were missing. (net8.0/net9.0 only) (#3953, #4294) - Fixed
DateOnlyvalues written to asql_variantcolumn of a table-valued parameter being sent asdatetimeinstead ofdate. Besides being incorrect, this caused an overflow forDateOnlyvalues that are valid fordatebut out of range fordatetime. Reading continues to returnDateTimeinstances by default, for backwards compatibility. (net8.0/net9.0 only — .NET Framework has noDateOnlytype) (#3934, #4439) - Fixed the
ServerCertificateconnection-string keyword not being honored when the platform reported no TLS policy errors. The configured certificate is now always compared against the certificate presented by the server, matching the documented exact-match semantic. If the configured file cannot be loaded or parsed, the connection now fails closed with anSSLCertificateAuthenticationExceptionnaming the path, rather than silently falling back to host-name validation. A null server certificate now throwsAuthenticationExceptioninstead ofNullReferenceException. Connections that do not setServerCertificate, and those whose configured certificate matches, are unaffected. (#4445) - Fixed
SqlConnection.AccessTokenCallbacknot disabling Transparent Network IP Resolution by default, unlikeSqlConnection.AccessToken. Also fixed a related defect in how the authentication setters build the connection pool key, and madeSspiContextProvidermutually exclusive with token-based authentication. (net462 only for the TNIR behavior) (#4520) - Fixed several async entry points in
SqlBulkCopy,SqlDataReader.InvokeAsyncCall,SqlCommand.Reader, andSqlCommand.Xmlthat captured fatal exceptions such asOutOfMemoryExceptioninto faultedTasks instead of letting them propagate. (#4437) - Fixed
Authentication=Active Directory Service Principal(and the interactive, password, integrated, and device-code flows) failing against endpoints such as the Dataverse / Dynamics 365 TDS endpoint, which return a multi-segment Entra ID authority (https://login.microsoftonline.com/{tenantId}/oauth2/authorize) in the TDSFEDAUTHINFOtoken. The tenant id is now taken from the first path segment of the authority instead of the last. This fix ships inMicrosoft.Data.SqlClient.Extensions.Azure; see its 7.1.0-preview3 release notes. (#4496, #4521)
- Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider 7.1.0-preview3
- Microsoft.Data.SqlClient.Extensions.Azure 7.1.0-preview3
- Microsoft.Data.SqlClient.Extensions.Abstractions 7.1.0-preview3
- Microsoft.Data.SqlClient.Internal.Logging 7.1.0-preview3
- .NET Framework 4.6.2+ (Windows x86, Windows x64, Windows ARM64)
- .NET 8.0+ (Windows x86, Windows x64, Windows ARM, Windows ARM64, Linux, macOS)
- Microsoft.Bcl.Cryptography 9.0.18
- Microsoft.Data.SqlClient.Extensions.Abstractions 7.1.0-preview3
- Microsoft.Data.SqlClient.Internal.Logging 7.1.0-preview3
- Microsoft.Data.SqlClient.SNI.runtime 7.1.0-preview3.26226.3
- Microsoft.Extensions.Caching.Memory 9.0.18
- Microsoft.IdentityModel.JsonWebTokens 8.16.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect 8.16.0
- Microsoft.SqlServer.Server 1.0.0
- System.Configuration.ConfigurationManager 9.0.18
- System.Security.Cryptography.Pkcs 9.0.18
- System.Threading.RateLimiting 9.0.18
- Microsoft.Bcl.Cryptography 8.0.0
- Microsoft.Data.SqlClient.Extensions.Abstractions 7.1.0-preview3
- Microsoft.Data.SqlClient.Internal.Logging 7.1.0-preview3
- Microsoft.Data.SqlClient.SNI.runtime 7.1.0-preview3.26226.3
- Microsoft.Extensions.Caching.Memory 8.0.1
- Microsoft.IdentityModel.JsonWebTokens 8.16.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect 8.16.0
- Microsoft.SqlServer.Server 1.0.0
- System.Configuration.ConfigurationManager 8.0.1
- System.Security.Cryptography.Pkcs 8.0.1
- System.Threading.RateLimiting 8.0.0
- Microsoft.Bcl.Cryptography 8.0.0
- Microsoft.Bcl.TimeProvider 8.0.1
- Microsoft.Data.SqlClient.Extensions.Abstractions 7.1.0-preview3
- Microsoft.Data.SqlClient.Internal.Logging 7.1.0-preview3
- Microsoft.Data.SqlClient.SNI.runtime 7.1.0-preview3.26226.3
- Microsoft.Extensions.Caching.Memory 8.0.1
- Microsoft.IdentityModel.JsonWebTokens 8.16.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect 8.16.0
- Microsoft.SqlServer.Server 1.0.0
- System.Configuration.ConfigurationManager 8.0.1
- System.Security.Cryptography.Pkcs 8.0.1
- System.Text.Json 10.0.3
- System.Threading.Channels 10.0.3
- System.Threading.RateLimiting 8.0.0
- Microsoft.Bcl.Cryptography 8.0.0
- Microsoft.Bcl.TimeProvider 8.0.1
- Microsoft.Data.SqlClient.Extensions.Abstractions 7.1.0-preview3
- Microsoft.Data.SqlClient.Internal.Logging 7.1.0-preview3
- Microsoft.Data.SqlClient.SNI 7.1.0-preview3.26226.3
- Microsoft.Extensions.Caching.Memory 8.0.1
- Microsoft.IdentityModel.JsonWebTokens 8.16.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect 8.16.0
- System.Buffers 4.6.1
- System.Data.Common 4.3.0
- System.Diagnostics.DiagnosticSource 10.0.3
- System.Memory 4.6.3
- System.Runtime.InteropServices.RuntimeInformation 4.3.0
- System.Security.Cryptography.Pkcs 8.0.1
- System.Text.Json 10.0.3
- System.Threading.Channels 10.0.3
- System.Threading.RateLimiting 8.0.0
- System.ValueTuple 4.6.2