Releases: dotnet/SqlClient
Stable Release v5.1.7
This update brings the following changes since the 5.1.6 release:
Fixed
- Fixed possible
NullPointerExceptionduring socket receive (PR #3285) - Fixed inconsistencies between source and reference projects (PR #3180)
Changed
- Updated the following dependencies:
- Microsoft.Data.SqlClient.SNI 5.1.1 to 5.1.2 for .NET Framework on Windows (PR #3294)
- Microsoft.Data.SqlClient.SNI.runtime 5.1.1 to 5.1.2 for .NET on Windows (PR #3294)
- Microsoft.Extensions.Caching.Memory 6.0.1 to 6.0.3 - Avoid CVE-2024-43483 (PR #3068)
- Microsoft.Extensions.Hosting 6.0.0 to 6.0.1 - Avoid transitive dependency on vulnerable System.Text.Json 6.0.0 (PR #3207)
- System.Private.Uri 4.3.2 - Avoid transitive CVE-2019-0820 (PR #3077)
- System.Text.Encodings.Web 6.0.0 to 6.0.1 - Avoid transitive downgrade for .NET Framework targets (PR #3279)
- System.Text.Json 6.0.11 - Avoid transitive dependencies on older vulnerable versions for .NET Framework targets (PR #3279)
Stable Release v6.0.2
This update brings the below changes over the previous release:
Fixed
- Fixed possible
NullPointerExceptionduring socket receive #3283 - Fixed reference assembly definitions for SqlJson APIs #3169
- Fixed an error reading the output parameter of type JSON while executing stored procedure #3173
Changed
- Updated the below dependencies:
- Updated Microsoft.Bcl.Cryptography from 9.0.0 to 9.0.4 for .NET 9 targeted dll. #3281
- Updated Microsoft.Extensions.Caching.Memory from 9.0.0 to 9.0.4 for .NET 9 targeted dll. #3281
- Updated System.Configuration.ConfigurationManager from 9.0.0 to 9.0.4 for .NET 9 targeted dll. #3281
- Updated System.Security.Cryptography.Pkcs from 9.0.0 to 9.0.4 for .NET 9 targeted dll. #3281
Stable Release v6.0.1
Released to NuGet.org on 2025-01-23
Breaking Changes
- Removed support for .NET Standard. #2386
- Removed support for .NET 6 #2927
- Removed UWP (UAP) references. #2483
- Removed SQL 2000 client-side debugging support for .NET Framework #2981, #2940
Added
JSON Support
JSON data type support is now available in Microsoft.Data.SqlClient v6.0. This release introduces SqlJson type available as an extension to System.Data.SqlDbTypes:
using System;
using System.Data.SqlTypes;
using System.Text.Json;
namespace Microsoft.Data.SqlTypes
{
/// <summary>
/// Represents the JSON data type in SQL Server.
/// </summary>
public class SqlJson : INullable
{
/// <summary>
/// Parameterless constructor. Initializes a new instance of the SqlJson class which
/// represents a null JSON value.
/// </summary>
public SqlJson() { }
/// <summary>
/// Takes a <see cref="string"/> as input and initializes a new instance of the SqlJson class.
/// </summary>
/// <param name="jsonString"></param>
public SqlJson(string jsonString) { }
/// <summary>
/// Takes a <see cref="JsonDocument"/> as input and initializes a new instance of the SqlJson class.
/// </summary>
/// <param name="jsonDoc"></param>
public SqlJson(JsonDocument jsonDoc) { }
/// <inheritdoc/>
public bool IsNull => throw null;
/// <summary>
/// Represents a null instance of the <see cref="SqlJson"/> type.
/// </summary>
public static SqlJson Null { get { throw null; } }
/// <summary>
/// Gets the string representation of the Json content of this <see cref="SqlJson" /> instance.
/// </summary>
public string Value { get ; }
}
}The JSON data type supports reading, writing, streaming, and performing bulk copy operations.
Introducing SqlClientDiagnostics
SqlClientDiagnostic is now available as a strongly-typed collection of key-value pairs that can be captured by consuming applications.
// Class that provides strongly-typed collection of key-value pairs for SqlClient diagnostic objects.
public abstract class SqlClientDiagnostic : System.Collections.Generic.IReadOnlyList<System.Collections.Generic.KeyValuePair<string, object>>
{
// A guid value used to correlate before, after and error events.
public System.Guid OperationId;
// The name of the operation.
public string Operation;
// The timestamp of the event.
public long Timestamp;
// The number of elements in the collection.
public int Count;
// The element at the specified index in the read-only list.
public System.Collections.Generic.KeyValuePair<string, object> this[int index];
// An enumerator that can be used to iterate through the collection.
public System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<string, object>> GetEnumerator();
}Added Support for Connection Overrides in OpenAsync() API
The default behavior of SqlConnection.OpenAsync() can be overridden to disable the ten-second delay and automatic connection retries triggered by transient errors.
using(SqlConnection sqlConnection = new SqlConnection("Data Source=(local);Integrated Security=true;Initial Catalog=AdventureWorks;"))
{
await sqlConnection.OpenAsync(SqlConnectionOverrides.OpenWithoutRetry, cancellationToken);
}Other Additions
- Added support for .NET 9 #2946
- Added localization in Czech, Polish, and Turkish #2987
- Added
TokenCredentialobject to take advantage of token caching inActiveDirectoryAuthenticationProvider. #2380 - Added support for using
DateOnlyandTimeOnlyinDataTableandSqlDataRecordstructured parameters. #2258 - Added scope trace for
GenerateSspiClientContext. #2497, #2725 - Added readme to NuGet package #2826
- Enabled NuGet package auditing via NuGet.org audit source #3024
- Added missing SqlCommand_BeginExecuteReader code sample #3009
Fixed
- Fixed
Socket.Connecttimeout issue caused by thread starvation. #2777 - Fixed pending data with
SqlDataReaderagainst an encrypted column. #2618 - Fixed Entra authentication when using infinite connection timeout in
ActiveDirectoryAuthenticationProvider. #2651 - Fixed
GetSchemaby excluding unsupported engines due to lack of support forASSEMBLYPROPERTYfunction. #2593 - Fixed SSPI retry negotiation with default port in .NET. #2559
- Fixed assembly path in .NET 8.0 and
.AssemblyAttributes. #2550 - Fixed certificate chain validation. #2487
- Fixed clone of
SqlConnectionto includeAccessTokenCallback. #2525 - Fixed issue with
DateTimeOffsetin table-valued parameters, which was introduced in 5.2. #2453 - Fixed
ArgumentNullExceptiononSqlDataRecord.GetValuewhen using user-defined data type on .NET. #2448 - Fixed
SqlBufferandSqlGuidwhen it's null. #2310 - Fixed
SqlBulkCopy.WriteToServerstate in a consecutive calls. #2375 - Fixed null reference exception with
SqlConnection.FireInfoMessageEventOnUserErrorsafter introducing the batch command. #2399 - Fixed scale serialization when explicitly set to 0 #2411
- Fixed issue blocking
GetSchemacommands from being enrolled into the current transaction #2876 - Adjusted retry logic to allow errors with negative numbers to be considered transient #2896
- Fixed string formatting in
OutOfMemoryexceptions #2797 - Increased routing attempts to 10 in netcore for
LoginNoFailoverand added routing support toLoginWithFailoverto standardize routing behavior between netcore and netfx #2873 - Restructured documentation into XML format so that it displays correctly in Visual Studio #2836, #2822, #2834, #2851, #2863, #2864, #2865, #2869, #2871, #2837, #2821
- Fixed cleanup behavior when column decryption fails. Prevents leaving stale data on the wire for pooled connections #2843, #2825
- Reverted default value of
UseMinimumLoginTimeoutcontext switch to 'true' #2419 - Added missing
DynamicallyAccessedMembersattributes in .NET Runtime reference assemblies. #2946 - Synchronized dependencies of reference assemblies with runtime assemblies #2878
- Fixed lazy initialization of the
_SqlMetaDatahidden column map for .NET Framework #2964 - Fixed reference assembly definitions for SqlClientDiagnostic APIs #3097
- Fixed issue with down-level SSL/TLS version warnings #3126
Changed
- Dependency changes
- Added dependency on
Microsoft.Bcl.Cryptography:9.0.0#2946 - Added dependency on
System.Security.Cryptography.Pkcs:9.0.0to address SYSLIB0057#2946 - Added dependency on
System.Text.Json8.0.5for .NET 8+ and6.0.10for other versions #2921 - Removed dependency on
Microsoft.Extensions.Caching.MemoryandSystem.Security.Cryptography.Cng, which were unnecessary after removing .NET Standard. #2577 - Removed dependency on
System.Text.Jsonfrom .NET 8+ #2930
...
- Added dependency on
Preview Release 6.0.0-preview3.24332.3
Breaking Changes
- Dropped support for .NET 6 #2927
- Removed SQL 2000 client-side debugging support for .NET Framework #2981, #2940
Added
- Enabled NuGet package auditing via NuGet.org audit source #3024
- Added support for .NET 9 #2946
- Added dependency on System.Security.Cryptography.Pkcs:9.0.0 to address SYSLIB0057#2946
- Added dependency on Microsoft.Bcl.Cryptography:9.0.0 #2946
- Added missing SqlCommand_BeginExecuteReader code sample #3009
- Added support for SqlConnectionOverrides in OpenAsync() API #2433
- Added localization in Czech, Polish, and Turkish #2987
Fixed
- Reverted default value of UseMinimumLoginTimeout context switch to 'true' #2419
- Added missing DynamicallyAccessedMembers attributes in .NET Runtime reference assemblies. #2946
- Synchronized dependencies of Reference Assemblies with Runtime assemblies #2878
- Fixed lazy initialization of the _SqlMetaData hidden column map for .NET Framework #2964
Changed
- Updated Microsoft.Extensions.Caching.Memory to 9.0.0 for all frameworks #2946
- Updated System.Configuration.ConfigurationManager to 9.0.0 #2946
- Updated docs to use absolute links #2949
- Removed System.Text.Json dependency from .NET 8 #2930
Contributors
Thanks to the following public contributors. Their efforts toward this project are very much appreciated.
For detailed release notes, refer to 6.0.0-preview3.md
Preview Release v6.0.0-preview2.24304.8
Added
- Added a dependency on System.Text.Json 8.0.5 for .NET 8+ and 6.0.10 for other versions #2921
- Added support for JSON native datatype currently in Public preview in SQL Server. #2916, #2892, #2891, #2880, #2882, #2829, #2830
- Added readme to nuget package #2826
Fixed
- Fixed scale serialization when explicitly set to 0 #2411
- Fixed issue blocking GetSchema commands from being enrolled into the current transaction #2876
- Adjusted retry logic to allow errors with negative numbers to be considered transient #2896
- Fixed string formatting in OutOfMemory exceptions #2797
- Increased routing attempts to 10 in netcore for LoginNoFailover and added routing support to LoginWithFailover to standardize routing behavior between netcore and netfx #2873
- Restructured documentation into XML format so that it displays correctly in visual studio #2836, #2822, #2834, #2851, #2863, #2864, #2865, #2869, #2871, #2837, #2821
- Fixed cleanup behavior when column decryption fails. Prevents leaving stale data on the wire for pooled connections #2843, #2825
Changed
- Updated System.Configuration.ConfigurationManager from 8.0.0 to 8.0.1 for .Net 8 #2921
- Updated Microsoft.Extensions.Caching.Memory from 8.0.0 to 8.0.1 for .Net 8 #2921
- Code Health Improvements #2915, #2844, #2812, #2805, #2897, #2376, #2814, #2889, #2885, #2854, #2835, #2442, #2820, #2831, #2907, #2910, #2898, #2928, #2929, #2936, #2939
New Contributors
- @Markeli made their first contribution in #2797
- @EamonHetherton made their first contribution in #2411
For detailed release notes, refer to 6.0.0-preview2.md
Preview Release v6.0.0-preview1.24240.8
[Preview Release 6.0.0-preview1.24240.8] - 2024-08-27
This update brings the below changes over the 5.2 release:
Breaking Changes
Added
- Added
TokenCredentialobject to take advantage of token caching inActiveDirectoryAuthenticationProvider. #2380 - Added
DateOnlyandTimeOnlysupport toDataTableas a structured parameter. #2258 - Added
Microsoft.Data.SqlClient.Diagnostics.SqlClientDiagnostictype in .NET. #2226 - Added scope trace for
GenerateSspiClientContext. #2497, #2725
Fixed
- Fixed
Socket.Connecttimeout issue caused by thread starvation. #2777 - Fixed pending data with
SqlDataReaderagainst an encrypted column. #2618 - Fixed Entra authentication when using infinite connection timeout in
ActiveDirectoryAuthenticationProvider. #2651 - Fixed
GetSchemaby excluding unsupported engines due to lack of support forASSEMBLYPROPERTYfunction. #2593 - Fixed SSPI retry negotiation with default port in .NET. #2559
- Fixed assembly path in .NET 8.0 and
.AssemblyAttributes. #2550 - Fixed certificate chain validation. #2487
- Fixed clone of
SqlConnectionto includeAccessTokenCallback. #2525 - Fixed issue with
DateTimeOffsetin table-valued parameters, which was introduced in 5.2. #2453 - Fixed
ArgumentNullExceptiononSqlDataRecord.GetValuewhen using user-defined data type on .NET. #2448 - Fixed
SqlBufferandSqlGuildwhen it's null. #2310 - Fixed
SqlBulkCopy.WriteToServerstate in a consecutive calls. #2375 - Fixed null reference exception with
SqlConnection.FireInfoMessageEventOnUserErrorsafter introducing the batch command. #2399
Changed
- Updated Microsoft.Data.SqlClient.SNI version to
6.0.0-preview1.24226.4. #2772 - Improved access to
SqlAuthenticationProviderManager.Instanceand avoid early object initiation. #2636 - Removed undocumented properties of
Azure.IdentityinActiveDirectoryAuthenticationProvider. #2562 - Replaced
System.Runtime.CachingwithMicrosoft.Extensions.Caching.Memory. #2493 - Updated
EnableOptimizedParameterBindingto only accept text mode commands. #2417 - Updated
Azure.Identityversion from1.10.3to1.11.4. #2577 - Updated
Azure.Coreversion from1.35.0to1.38.0. #2462 - Updated
Azure.Security.KeyVault.Keysversion from4.4.0to4.5.0. #2462 - Updated
Microsoft.IdentityModel.JsonWebTokensandMicrosoft.IdentityModel.Protocols.OpenIdConnectfrom6.35.0to7.5.0. #2429 - Removed direct dependency to
Microsoft.Identity.Clientto take the transient dependecy throughAzure.Identity. #2577 - Removed unnecessary references
Microsoft.Extensions.Caching.MemoryandSystem.Security.Cryptography.Cngafter removing .NET Standard. #2577 - Improved memory allocation when reader opened by
CommandBehavior.SequentialAccessover the big string columns. #2356 - Improved SSPI by consolidating the context generation to single abstraction and using memory/span for SSPI generation. #2255, #2447
- Reverted the #2281 code changes on ManagedSNI. #2395
- Updated assembly version to 6.0.0.0. #2382
- Code health improvements: #2366, #2369, #2381, #2390, #2392, #2403, #2410, #2413, #2425, #2428, #2440, #2443, #2450, #2466, #2486, #2521, #2522, #2533, #2552, #2560, #2726, #2751, #2811
For detailed release notes, refer to 6.0.0-preview1.md
Stable release v5.1.6
[Stable release 5.1.6] - 2024-08-27
Fixed
- Fixed Transient fault handling issue with
OpenAsync. #1983 #2508 - Fixed
AcquireTokenAsynctimeout handling for edge cases inActiveDirectoryAuthenticationProvider. #2706 - Fixed pending data with
SqlDataReaderagainst an encrypted column. #2618 #2818
Changed
- Upgraded
Azure.Identityversion from 1.11.3 to 1.11.4 [#2649] (#2649) [#2529] (#2529) to address CVE-2024-35255. - Upgraded
Microsoft.Identity.Clientversion from 4.60.0 to 4.61.3 [#2649] (#2649) [#2529] (#2529) to address CVE-2024-35255. - Added caching to
TokenCredentialobjects to take advantage of token caching. #2776 - Code health improvements: [#2490] (#2490)
Stable release v5.2.2
[Stable release 5.2.2] - 2024-08-27
Fixed
- Fixed
AcquireTokenAsynctimeout handling for edge cases inActiveDirectoryAuthenticationProvider. #2650 - Fixed issue with
Socket.Connectin managed SNI. #2779 - Fixed path for
AssemblyAttributesin obj folder causing NET 8.0 assembly to appear in NET 6.0 dll. #2789 - Fixed SSPI retry negotiation with default port in .NET. #2815
- Fixed
ArgumentNullExceptiononSqlDataRecord.GetValuewhen using user-defined data type on .NET. #2816 - Fixed pending data with
SqlDataReaderagainst an encrypted column. #2817
Changed
- Upgraded
Azure.Identityversion from 1.11.3 to 1.11.4 #2648 to address CVE-2024-35255. - Upgraded
Microsoft.Identity.Clientversion from 4.60.0 to 4.61.3 #2648 to address CVE-2024-35255. - Added caching to
TokenCredentialobjects to take advantage of token caching. #2775
Stable release v4.0.6
Stable release v3.1.7
[Stable release 3.1.7] - 2024-08-20
Fixed
- Fixed connection to unsubscribe from transaction completion events before returning it to the connection pool. #2301 #2434
- Fixed
AcquireTokenAsynctimeout handling for edge cases inActiveDirectoryAuthenticationProvider. #2709 - Fixed the signing issue with
Microsoft.Data.SqlClientassembly. #2789