Skip to content

Commit 76c56fe

Browse files
MDS v7.0 release updates
1 parent 7472d78 commit 76c56fe

6 files changed

Lines changed: 394 additions & 33 deletions

docs/connect/ado-net/appcontext-switches.md

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ title: AppContext switches in SqlClient
33
description: Learn about the AppContext switches available in SqlClient and how to use them to modify some default behaviors.
44
author: cheenamalhotra
55
ms.author: cmalhotra
6-
ms.date: 08/19/2025
6+
ms.date: 03/17/2026
77
ms.service: sql
88
ms.subservice: connectivity
99
ms.topic: concept-article
1010
dev_langs:
1111
- "csharp"
1212
ms.custom: sfi-ropc-nochange
13+
ai-usage: ai-assisted
1314
---
1415
# AppContext switches in SqlClient
1516

@@ -19,6 +20,55 @@ ms.custom: sfi-ropc-nochange
1920

2021
The AppContext class allows SqlClient to provide new functionality while continuing to support callers who depend on the previous behavior. Users can opt out of a change in behavior by setting specific AppContext switches.
2122

23+
## Enable MultiSubnetFailover by default
24+
25+
[!INCLUDE [dotnet-all](../../includes/products/applies-plain/dotnet-all.md)]
26+
27+
(Available starting with version 7.0)
28+
29+
To set `MultiSubnetFailover=true` globally without modifying individual connection strings, you can enable the AppContext switch **"Switch.Microsoft.Data.SqlClient.EnableMultiSubnetFailoverByDefault"** to `true` at application startup:
30+
31+
```csharp
32+
AppContext.SetSwitch("Switch.Microsoft.Data.SqlClient.EnableMultiSubnetFailoverByDefault", true);
33+
```
34+
35+
You can also enable this switch in your App.Config:
36+
37+
```xml
38+
<runtime>
39+
<AppContextSwitchOverrides value="Switch.Microsoft.Data.SqlClient.EnableMultiSubnetFailoverByDefault=true" />
40+
</runtime>
41+
```
42+
43+
When enabled, all connections behave as if `MultiSubnetFailover=true` is set in the connection string. This switch is disabled by default.
44+
45+
## Enable packet multiplexing for async reads
46+
47+
[!INCLUDE [dotnet-all](../../includes/products/applies-plain/dotnet-all.md)]
48+
49+
(Available starting with version 7.0)
50+
51+
Packet multiplexing improves performance for large async read operations such as `ExecuteReaderAsync` with big result sets, streaming scenarios, or bulk data retrieval. This feature is controlled by two opt-in AppContext switches. Setting both switches to `false` enables the new async processing path:
52+
53+
```csharp
54+
AppContext.SetSwitch("Switch.Microsoft.Data.SqlClient.UseCompatibilityAsyncBehaviour", false);
55+
AppContext.SetSwitch("Switch.Microsoft.Data.SqlClient.UseCompatibilityProcessSni", false);
56+
```
57+
58+
By default, both switches are `true`, which preserves the existing (compatible) behavior.
59+
60+
## Enable User Agent feature extension
61+
62+
[!INCLUDE [dotnet-all](../../includes/products/applies-plain/dotnet-all.md)]
63+
64+
(Available starting with version 7.0)
65+
66+
When the AppContext switch **"Switch.Microsoft.Data.SqlClient.EnableUserAgent"** is enabled, the driver sends more detailed user agent strings during connection. This information assists with troubleshooting and quantifying driver usage by version and operating system. This switch is disabled by default. To enable it, set the AppContext switch to `true` at application startup:
67+
68+
```csharp
69+
AppContext.SetSwitch("Switch.Microsoft.Data.SqlClient.EnableUserAgent", true);
70+
```
71+
2272
## Enabling decimal truncation behavior
2373

2474
[!INCLUDE [dotnet-all](../../includes/products/applies-plain/dotnet-all.md)]

docs/connect/ado-net/download-microsoft-sqlclient-data-provider.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Download page for ADO.NET and Microsoft SqlClient Data Provider for
44
author: cheenamalhotra
55
ms.author: cmalhotra
66
ms.reviewer: randolphwest
7-
ms.date: 11/21/2025
7+
ms.date: 03/17/2026
88
ms.service: sql
99
ms.subservice: connectivity
1010
ms.topic: how-to
@@ -25,6 +25,5 @@ For more information about version compatibility and support, see [SQL version c
2525

2626
## Download supported versions of Microsoft SqlClient Data Provider for SQL Server
2727

28-
- [6.1.3](https://www.nuget.org/packages/Microsoft.Data.SqlClient/6.1.3)
29-
- [6.0.4](https://www.nuget.org/packages/Microsoft.Data.SqlClient/6.0.4)
30-
- [5.1.8](https://www.nuget.org/packages/Microsoft.Data.SqlClient/5.1.8)
28+
- [7.0.0](https://www.nuget.org/packages/Microsoft.Data.SqlClient/7.0.0)
29+
- [6.1.4](https://www.nuget.org/packages/Microsoft.Data.SqlClient/6.1.4)

docs/connect/ado-net/introduction-microsoft-data-sqlclient-namespace.md

Lines changed: 224 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn about the Microsoft.Data.SqlClient namespace and how it's the
44
author: cheenamalhotra
55
ms.author: cmalhotra
66
ms.reviewer: randolphwest
7-
ms.date: 11/18/2025
7+
ms.date: 03/17/2026
88
ms.service: sql
99
ms.subservice: connectivity
1010
ms.topic: whats-new
@@ -24,6 +24,229 @@ There are a few differences in less-used APIs compared to System.Data.SqlClient
2424

2525
The Microsoft.Data.SqlClient API details can be found in the [.NET API Browser](/dotnet/api/microsoft.data.sqlclient).
2626

27+
## Stable Release 7.0.0 - 2026-03-17
28+
29+
This is the general availability release of **Microsoft.Data.SqlClient 7.0**, a major milestone for the .NET data provider for SQL Server. This release addresses the most upvoted issue in the repository's history — extracting Azure dependencies from the core package — introduces pluggable SSPI authentication, adds enhanced routing for Azure SQL Hyperscale, and delivers async read performance improvements.
30+
31+
Also released as part of this milestone:
32+
- Released Microsoft.Data.SqlClient.Extensions.Abstractions 1.0.0. See [release notes](../Extensions/Abstractions/1.0/1.0.0.md).
33+
- Released Microsoft.Data.SqlClient.Extensions.Azure 1.0.0. See [release notes](../Extensions/Azure/1.0/1.0.0.md).
34+
- Released Microsoft.Data.SqlClient.Internal.Logging 1.0.0. See [release notes](../Internal/Logging/1.0/1.0.0.md).
35+
- Released Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider 7.0.0. See [release notes](../add-ons/AzureKeyVaultProvider/7.0/7.0.0.md).
36+
37+
### Breaking Changes
38+
39+
#### Azure Dependencies Removed from Core Package
40+
41+
*What Changed:*
42+
43+
- The core `Microsoft.Data.SqlClient` package no longer depends on `Azure.Core`, `Azure.Identity`, or their transitive dependencies (e.g., `Microsoft.Identity.Client`, `Microsoft.Web.WebView2`). Azure Active Directory / Entra ID authentication functionality (`ActiveDirectoryAuthenticationProvider` and related types) has been extracted into a new `Microsoft.Data.SqlClient.Extensions.Azure` package.
44+
([#1108](https://github.com/dotnet/SqlClient/issues/1108),
45+
[#3680](https://github.com/dotnet/SqlClient/pull/3680),
46+
[#3902](https://github.com/dotnet/SqlClient/pull/3902),
47+
[#3904](https://github.com/dotnet/SqlClient/pull/3904),
48+
[#3908](https://github.com/dotnet/SqlClient/pull/3908),
49+
[#3917](https://github.com/dotnet/SqlClient/pull/3917),
50+
[#3982](https://github.com/dotnet/SqlClient/pull/3982),
51+
[#3978](https://github.com/dotnet/SqlClient/pull/3978),
52+
[#3986](https://github.com/dotnet/SqlClient/pull/3986))
53+
- Two additional packages were introduced to support this separation: `Microsoft.Data.SqlClient.Extensions.Abstractions` (shared types between the core driver and extensions) and `Microsoft.Data.SqlClient.Internal.Logging` (shared ETW tracing infrastructure).
54+
([#3626](https://github.com/dotnet/SqlClient/pull/3626),
55+
[#3628](https://github.com/dotnet/SqlClient/pull/3628),
56+
[#3967](https://github.com/dotnet/SqlClient/pull/3967),
57+
[#4038](https://github.com/dotnet/SqlClient/pull/4038))
58+
59+
*Who Benefits:*
60+
61+
- All users benefit from a significantly lighter core package. Previously, the Azure dependency chain pulled in numerous assemblies even for applications that only needed basic SQL Server connectivity. This was the [most upvoted open issue](https://github.com/dotnet/SqlClient/issues/1108) in the repository.
62+
- Users who do not use Entra ID authentication no longer carry Azure-related assemblies in their build output.
63+
- Users who do use Entra ID authentication can now manage Azure dependency versions independently from the core driver.
64+
65+
*Impact:*
66+
67+
- Applications using Entra ID authentication (e.g., `ActiveDirectoryInteractive`, `ActiveDirectoryDefault`, `ActiveDirectoryManagedIdentity`, etc.) must now install the `Microsoft.Data.SqlClient.Extensions.Azure` NuGet package separately:
68+
69+
```console
70+
dotnet add package Microsoft.Data.SqlClient.Extensions.Azure
71+
```
72+
73+
- No code changes are required beyond adding the package reference.
74+
- If an Entra ID authentication method is used without the Azure package installed, the driver now provides an actionable error message guiding users to install the correct package.
75+
76+
#### Other breaking changes
77+
78+
- Reverted public visibility of internal interop enums (`IoControlCodeAccess` and `IoControlTransferType`) that were accidentally made public during the project merge.
79+
([#3900](https://github.com/dotnet/SqlClient/pull/3900))
80+
81+
### Added
82+
83+
#### Pluggable Authentication with SspiContextProvider
84+
85+
*What Changed:*
86+
87+
- Added a public `SspiContextProvider` property on `SqlConnection`, completing the SSPI extensibility work begun in 6.1.0. Applications can now supply a custom SSPI context provider for integrated authentication, enabling custom Kerberos ticket negotiation and NTLM username/password authentication scenarios.
88+
([#2253](https://github.com/dotnet/SqlClient/issues/2253),
89+
[#2494](https://github.com/dotnet/SqlClient/pull/2494))
90+
91+
*Who Benefits:*
92+
93+
- Users authenticating across untrusted domains, non-domain-joined machines, or cross-platform environments where configuring integrated authentication is difficult.
94+
- Users running in containers who need manual Kerberos negotiation without deploying sidecars or external ticket-refresh mechanisms.
95+
- Users who need NTLM username/password authentication to SQL Server, which the driver does not provide natively.
96+
97+
*Impact:*
98+
99+
- Applications can set a custom `SspiContextProvider` on `SqlConnection` before opening the connection:
100+
101+
```c#
102+
var connection = new SqlConnection(connectionString);
103+
connection.SspiContextProvider = new MyKerberosProvider();
104+
connection.Open();
105+
```
106+
107+
- The provider handles the authentication token exchange during integrated authentication. Existing authentication behavior is unchanged when no custom provider is set. See [SspiContextProvider_CustomProvider.cs](../../doc/samples/SspiContextProvider_CustomProvider.cs) for a sample implementation.
108+
- **Note:** The `SspiContextProvider` is part of the connection pool key. Care should be taken when using this property to ensure the implementation returns a stable identity per resource.
109+
110+
#### Async Read Performance: Packet Multiplexing (Preview)
111+
112+
*What Changed:*
113+
114+
- Continued refinement of packet multiplexing with bug fixes and stability improvements since 6.1.0, plus new app context switches for opt-in control.
115+
([#3534](https://github.com/dotnet/SqlClient/pull/3534),
116+
[#3537](https://github.com/dotnet/SqlClient/pull/3537),
117+
[#3605](https://github.com/dotnet/SqlClient/pull/3605))
118+
119+
*Who Benefits:*
120+
121+
- Applications performing large async reads (`ExecuteReaderAsync` with big result sets, streaming scenarios, or bulk data retrieval).
122+
123+
*Impact:*
124+
125+
- Packet multiplexing ships behind two opt-in feature switches:
126+
127+
```c#
128+
AppContext.SetSwitch("Switch.Microsoft.Data.SqlClient.UseCompatibilityAsyncBehaviour", false);
129+
AppContext.SetSwitch("Switch.Microsoft.Data.SqlClient.UseCompatibilityProcessSni", false);
130+
```
131+
132+
- Setting both switches to `false` enables the new async processing path. By default, the driver uses the existing (compatible) behavior.
133+
134+
#### Enhanced Routing Support
135+
136+
*What Changed:*
137+
138+
- Added support for enhanced routing, a TDS feature that allows the server to redirect connections to a specific server *and* database during login.
139+
([#3641](https://github.com/dotnet/SqlClient/issues/3641),
140+
[#3969](https://github.com/dotnet/SqlClient/pull/3969),
141+
[#3970](https://github.com/dotnet/SqlClient/pull/3970),
142+
[#3973](https://github.com/dotnet/SqlClient/pull/3973))
143+
144+
*Who Benefits:*
145+
146+
- Users connecting to Azure SQL Hyperscale environments that use named read replicas and gateway-based load balancing.
147+
148+
*Impact:*
149+
150+
- Enhanced routing is negotiated automatically during login when the server supports it. No application code changes are required.
151+
152+
#### Support for .NET 10
153+
154+
*What Changed:*
155+
156+
- Updated pipelines and test suites to compile the driver using the .NET 10 SDK.
157+
([#3686](https://github.com/dotnet/SqlClient/pull/3686))
158+
159+
*Who Benefits:*
160+
161+
- Developers targeting .NET 10 on day one.
162+
163+
*Impact:*
164+
165+
- SqlClient 7.0 compiles and tests against .NET 10, ensuring compatibility.
166+
167+
#### Strongly-Typed Diagnostic Events on .NET Framework
168+
169+
*What Changed:*
170+
171+
- Enabled `SqlClientDiagnosticListener` for `SqlCommand` on .NET Framework, closing a long-standing observability gap where diagnostic events were previously only emitted on .NET Core.
172+
([#3658](https://github.com/dotnet/SqlClient/pull/3658))
173+
174+
- Brought the 15 strongly-typed diagnostic event classes in the `Microsoft.Data.SqlClient.Diagnostics` namespace — originally introduced for .NET Core in 6.0 — to .NET Framework as part of the codebase merge. Both platforms now use the same strongly-typed event model. The types cover command, connection, and transaction lifecycle events:
175+
- `SqlClientCommandBefore`, `SqlClientCommandAfter`, `SqlClientCommandError`
176+
- `SqlClientConnectionOpenBefore`, `SqlClientConnectionOpenAfter`, `SqlClientConnectionOpenError`
177+
- `SqlClientConnectionCloseBefore`, `SqlClientConnectionCloseAfter`, `SqlClientConnectionCloseError`
178+
- `SqlClientTransactionCommitBefore`, `SqlClientTransactionCommitAfter`, `SqlClientTransactionCommitError`
179+
- `SqlClientTransactionRollbackBefore`, `SqlClientTransactionRollbackAfter`, `SqlClientTransactionRollbackError`
180+
181+
([#3493](https://github.com/dotnet/SqlClient/pull/3493))
182+
183+
*Who Benefits:*
184+
185+
- .NET Framework users subscribing to `SqlClientDiagnosticListener` events for observability, distributed tracing, or custom telemetry. These users now have parity with .NET Core, gaining IntelliSense, compile-time safety, and eliminating the need to access diagnostic payloads via reflection or dictionary lookups.
186+
187+
*Impact:*
188+
189+
- On .NET Framework, `SqlCommand` now emits the same diagnostic events that were previously only available on .NET Core. Subscribers to `DiagnosticListener` events (e.g., `Microsoft.Data.SqlClient.WriteCommandBefore`) receive the strongly-typed objects:
190+
191+
```c#
192+
listener.Subscribe(new Observer<KeyValuePair<string, object?>>(kvp =>
193+
{
194+
if (kvp.Value is SqlClientCommandBefore before)
195+
{
196+
Console.WriteLine($"Executing: {before.Command.CommandText}");
197+
}
198+
}));
199+
```
200+
201+
- The types implement `IReadOnlyList<KeyValuePair<string, object>>` for backward compatibility with code that iterates properties generically.
202+
203+
#### Other Additions
204+
205+
- Added `SqlConfigurableRetryFactory.BaselineTransientErrors` static property exposing the default transient error codes list as a `ReadOnlyCollection<int>`, making it easier to extend the default list with application-specific error codes.
206+
([#3903](https://github.com/dotnet/SqlClient/pull/3903))
207+
208+
- Added app context switch `Switch.Microsoft.Data.SqlClient.EnableMultiSubnetFailoverByDefault` to set `MultiSubnetFailover=true` globally without modifying connection strings.
209+
([#3841](https://github.com/dotnet/SqlClient/pull/3841))
210+
211+
- Added app context switch `Switch.Microsoft.Data.SqlClient.IgnoreServerProvidedFailoverPartner` to let the client ignore server-provided failover partner info in Basic Availability Groups.
212+
([#3625](https://github.com/dotnet/SqlClient/pull/3625))
213+
214+
- Enabled User Agent Feature Extension (opt-in via `Switch.Microsoft.Data.SqlClient.EnableUserAgent`).
215+
([#3606](https://github.com/dotnet/SqlClient/pull/3606))
216+
217+
### Changed
218+
219+
#### Deprecation of `SqlAuthenticationMethod.ActiveDirectoryPassword`
220+
221+
*What Changed:*
222+
223+
- `SqlAuthenticationMethod.ActiveDirectoryPassword` (the ROPC flow) is now marked `[Obsolete]` and will generate compiler warnings. This aligns with Microsoft's move toward [mandatory multifactor authentication](https://learn.microsoft.com/entra/identity/authentication/concept-mandatory-multifactor-authentication).
224+
([#3671](https://github.com/dotnet/SqlClient/pull/3671))
225+
226+
*Who Benefits:*
227+
228+
- Teams moving toward stronger, passwordless or MFA-compliant authentication.
229+
230+
*Impact:*
231+
232+
- If you use `Authentication=Active Directory Password`, migrate to a supported alternative:
233+
234+
| Scenario | Recommended Authentication |
235+
|----------|---------------------------|
236+
| Interactive / desktop apps | `Active Directory Interactive` |
237+
| Service-to-service | `Active Directory Service Principal` |
238+
| Azure-hosted workloads | `Active Directory Managed Identity` |
239+
| Developer / CI environments | `Active Directory Default` |
240+
241+
- See [Connect to Azure SQL with Microsoft Entra authentication](https://learn.microsoft.com/sql/connect/ado-net/sql/azure-active-directory-authentication) for more information.
242+
243+
## Target Platform Support
244+
245+
- .NET Framework 4.6.2+ (Windows x86, Windows x64, Windows ARM64)
246+
- .NET 8.0+ (Windows x86, Windows x64, Windows ARM, Windows ARM64, Linux, macOS)
247+
248+
Full release notes, including dependencies, are available in the GitHub Repository: [7.0 Release Notes](https://github.com/dotnet/SqlClient/tree/main/release-notes/7.0).
249+
27250
## Release notes for Microsoft.Data.SqlClient 6.1
28251

29252
### New features in 6.1

docs/connect/ado-net/microsoft-ado-net-sql-server.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,3 @@ ADO.NET is the core data access technology for .NET languages. Use the Microsoft
6262
## More samples
6363

6464
* [ADO.NET Code Examples](/dotnet/framework/data/adonet/ado-net-code-examples)
65-

0 commit comments

Comments
 (0)