Skip to content

Commit c3c2814

Browse files
Merge branch 'main' into dev/cheena/port-ado-pr-8154
2 parents 413833e + 332e17f commit c3c2814

372 files changed

Lines changed: 22328 additions & 3038 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/ISSUE_TEMPLATE/bug-report.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Bug report
33
about: Create a report to help us improve
44
title: ""
5-
labels: [":new: Triage Needed", ":bug: Bug!"]
5+
type: Bug
66
assignees: []
77

88
---

‎.github/ISSUE_TEMPLATE/feature_request.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Feature request
33
about: Suggest an idea for this project
44
title: ""
5-
labels: [":new: Triage Needed", ":bulb: Enhancement"]
5+
type: Feature
66
assignees: []
77

88
---

‎.github/copilot-instructions.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
## 📚 Project Overview
1313
This project is a .NET data provider for SQL Server, enabling .NET applications to interact with SQL Server databases. It supports various features like connection pooling, transaction management, and asynchronous operations.
14-
The project builds from a **single unified project** at `src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj`. It targets `net8.0` and `net9.0` on all supported hosts, and adds `net462` only when building on Windows. The legacy `netfx/` and `netcore/` directories are being phased out — only their `ref/` folders (which define the public API surface) remain active.
14+
The project builds from a **single unified project** at `src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj`, targeting `net462;net10.0` (minimum runtime compatibility: .NET Framework 4.6.2 and .NET 10). Public API declarations are unified under `src/Microsoft.Data.SqlClient/ref/`; reference and unsupported-platform projects additionally preserve `netstandard2.0`. The legacy `netfx/` and `netcore/` directories are no longer used.
1515
The project includes:
16-
- **Public APIs**: Defined in `netcore/ref/` and `netfx/ref/` directories.
16+
- **Public APIs**: Defined by `src/Microsoft.Data.SqlClient/ref/Microsoft.Data.SqlClient.csproj` and the reference source files beside it.
1717
- **Implementations**: All source code in `src/Microsoft.Data.SqlClient/src/`.
1818
- **Tests**: Located in the `tests/` directory, covering unit and integration tests.
1919
- **Unit Tests**: Located in `src/Microsoft.Data.SqlClient/tests/UnitTests/`.
@@ -51,12 +51,12 @@ This project includes several key products and libraries that facilitate SQL Ser
5151
- **Logging and Diagnostics**: Provides event source tracing diagnostic capabilities for troubleshooting.
5252
- **Failover Support**: Handles automatic failover scenarios for high availability.
5353
- Compatibility switch: `Switch.Microsoft.Data.SqlClient.UseLegacyFailoverAlternationOnLoginSqlErrors` (default `false`) can restore legacy alternation behavior in `LoginWithFailover` for login-phase SQL errors.
54-
- **Cross-Platform Support**: Compatible with both .NET Framework and .NET Core, allowing applications to run on Windows, Linux, and macOS.
54+
- **Cross-Platform Support**: Compatible with .NET Framework 4.6.2+ on Windows and .NET 10+ on Windows, Linux, and macOS.
5555
- **Column Encryption AKV Provider**: Supports Azure Key Vault (AKV) provider for acquiring keys from Azure Key Vault to be used for encryption and decryption.
5656

5757
## 🧩 SNI Implementations
5858
There are two implementations of the SQL Server Network Interface (SNI) layer used in this project:
59-
- **Managed SNI**: A managed implementation of SNI that is used in .NET Core and .NET 5+ environments. It provides cross-platform support for SQL Server connectivity.
59+
- **Managed SNI**: A managed implementation of SNI that is used in .NET 10+ environments. It provides cross-platform support for SQL Server connectivity.
6060
- **Native SNI**: A native implementation of SNI that is used in .NET Framework and .NET Core environments on Windows. It's shipped as part of the `Microsoft.Data.SqlClient.SNI` and `Microsoft.Data.SqlClient.SNI.Runtime` packages.
6161
- **Microsoft.Data.SqlClient.SNI**: This package provides the native SNI layer for .NET Framework applications.
6262
- **Microsoft.Data.SqlClient.SNI.Runtime**: This package provides the native SNI layer for .NET Core applications on Windows.
@@ -137,7 +137,7 @@ When a new issue is created, follow these steps:
137137

138138
## 🧠 Contextual Awareness
139139
- All source code is in `src/Microsoft.Data.SqlClient/src/`. Do NOT add code to legacy `netfx/src/` or `netcore/src/` directories.
140-
- Only `ref/` folders in `netcore/ref/` and `netfx/ref/` remain active for defining the public API surface.
140+
- Public API changes must update the unified `src/Microsoft.Data.SqlClient/ref/` sources for each affected target framework.
141141
- Check for platform-specific differences using file suffixes (`.netfx.cs`, `.netcore.cs`, `.windows.cs`, `.unix.cs`) and conditional compilation (`#if NETFRAMEWORK`, `#if NET`, `#if _WINDOWS`, `#if _UNIX`).
142142
- Respect API compatibility rules across .NET versions
143143
- Do not introduce breaking changes without proper justification and documentation

‎.github/instructions/3rd-party-package-versions.instructions.md‎

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ applyTo: "**/Directory.Packages.props,**/*.csproj,**/Directory.Build.props,**/*.
33
---
44
# Choosing Third-Party Package Dependency Versions
55

6-
Guidance for choosing versions of **external (third-party) NuGet package dependencies** in multi-targeted projects (e.g. `net462;net8.0;net9.0`).
6+
Guidance for choosing versions of **external (third-party) NuGet package dependencies** in multi-targeted projects (e.g. `net462;net10.0`).
77

88
> **Scope:** This document covers dependencies consumed from NuGet — packages the SqlClient repo does NOT own. For versioning of SqlClient's own inter-sibling packages (Logging, Abstractions, SqlClient, Azure, AKV Provider, SqlServer.Server), see `sqlclient-package-versions.instructions.md`.
99
1010
## Rule
11-
For runtime-aligned packages, **the package major must match the target runtime major**: 8.x on `net8.0`, 9.x on `net9.0`, 10.x on `net10.0`, and so on. TFMs that aren't tied to a specific runtime major (`net462`, `netstandard2.0`) get the major of the floor LTS. Other categories are versioned as described below.
11+
For runtime-aligned packages, **the package major must match the target runtime major**: 10.x on `net10.0` in this branch. TFMs that aren't tied to a specific runtime major (`net462`, `net481`, `netstandard2.0`) get the major of the floor LTS. Other categories are versioned as described below.
1212

1313
Split package references into three categories:
1414

@@ -22,21 +22,19 @@ Packages whose major version ships with (or is tightly coupled to) a specific .N
2222
- `System.Text.Json`, `System.Memory`, `System.IO.Pipelines`, `System.Formats.Asn1`, `System.Security.Cryptography.Pkcs`
2323
- `Microsoft.Bcl.*`
2424

25-
Use the major version that matches the TFM. For TFMs without a corresponding runtime major (`net462`, `netstandard2.0`, etc.), use the major of the **lowest supported modern TFM** — typically the floor LTS (e.g. `8.x` while net8 is supported). This keeps the legacy targets on a long-lived, well-patched band and avoids dragging in transitive deps from a newer major:
25+
Use the major version that matches the TFM. For TFMs without a corresponding runtime major (`net462`, `net481`, `netstandard2.0`, etc.), use the major of the **lowest supported modern TFM** — currently .NET 10. This keeps the legacy targets on a long-lived, well-patched band and avoids dragging in transitive deps from a newer major:
2626

2727
```xml
28-
<!-- Defaults: lowest supported runtime band (e.g. net8 LTS); also applies to net462 / netstandard2.0 -->
28+
<!-- Defaults: .NET 10 LTS; also applies to net462 / net481 / netstandard2.0 -->
2929
<ItemGroup>
30-
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.1" />
31-
<PackageVersion Include="System.Text.Json" Version="8.0.5" />
32-
</ItemGroup>
33-
34-
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
35-
<PackageVersion Update="Microsoft.Extensions.Logging" Version="9.0.0" />
36-
<PackageVersion Update="System.Text.Json" Version="9.0.0" />
30+
<PackageVersion Include="Microsoft.Extensions.Logging" Version="10.0.0" />
31+
<PackageVersion Include="System.Text.Json" Version="10.0.0" />
3732
</ItemGroup>
3833
```
3934

35+
The versions above illustrate the runtime band; use the current stable servicing versions from
36+
`Directory.Packages.props`. No per-modern-TFM override is needed when only `net10.0` is targeted.
37+
4038
When the floor LTS drops out of support, bump the default block to the new floor LTS major and drop any conditional block that becomes redundant.
4139

4240
### 2. Independent packages — **single version across all TFMs**
@@ -52,15 +50,15 @@ Reference one (latest stable) version unconditionally:
5250

5351
```xml
5452
<PackageVersion Include="Newtonsoft.Json" Version="13.0.4" />
55-
<PackageVersion Include="Azure.Identity" Version="1.17.1" />
53+
<PackageVersion Include="Azure.Core" Version="1.62.0" />
5654
```
5755

5856
### 3. Polyfills — **conditional presence, single version**
5957

6058
Packages that only exist (or are only needed) on older TFMs. The polyfill major doesn't have to match any runtime band (older TFMs have no in-box equivalent), so pick the latest stable available:
6159

6260
```xml
63-
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'net462'">
61+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'net462' OR '$(TargetFramework)' == 'net481'">
6462
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="10.0.0" />
6563
</ItemGroup>
6664
```
@@ -96,7 +94,7 @@ Look at the "Frameworks" tab on nuget.org or open the `.nupkg`:
9694

9795
### 4. Functional test — remove the reference and rebuild
9896

99-
The decisive test for the polyfill-vs-runtime-aligned boundary: remove the `PackageReference` on a modern TFM (e.g. net8) and build.
97+
The decisive test for the polyfill-vs-runtime-aligned boundary: remove the `PackageReference` on the modern TFM (`net10.0`) and build.
10098

10199
- Builds clean → package was acting as a polyfill on that TFM. Confirm category 3.
102100
- Fails with `CS0246`/`CS1061` (missing type or method) → the package contributes API the in-box BCL doesn't have. Treat as runtime-aligned (category 1), even if the description sounds polyfill-ish.
@@ -143,13 +141,13 @@ The reverse (customer's direct version higher than your transitive) resolves cle
143141
| 10.x | 10.x or higher | Clean |
144142
| 8.x | 8.x or higher | Clean |
145143

146-
Pinning runtime-aligned packages to the **band matching each TFM** means a net8 consumer transitively gets 8.x (no friction with their own 8.x reference), and a net10 consumer transitively gets 10.x.
144+
For libraries supporting multiple modern runtimes, pinning runtime-aligned packages to the **band matching each TFM** means, for example, a net8 consumer transitively gets 8.x (no friction with their own 8.x reference), and a net10 consumer transitively gets 10.x.
147145

148-
Pinning everything to the latest major (e.g. `10.x` unconditionally) forces every net8 customer to roll their direct references forward or hit NU1605.
146+
In that example, pinning everything to the latest major (e.g. `10.x` unconditionally) forces every net8 customer to roll their direct references forward or hit NU1605. This branch no longer targets net8; its only modern band is `net10.0`, so the current default is 10.x.
149147

150148
### Independent packages don't have this problem
151149

152-
`Newtonsoft.Json 13.x`, `Azure.Identity 1.17.x`, etc. aren't tied to a runtime version. Customers don't have a "matching" version in mind, and the package's own multi-targeted assets handle TFM selection internally. One version is simpler and avoids needless conditional blocks.
150+
`Newtonsoft.Json 13.x`, `Azure.Core 1.62.x`, etc. aren't tied to a runtime version. Customers don't have a "matching" version in mind, and the package's own multi-targeted assets handle TFM selection internally. One version is simpler and avoids needless conditional blocks.
153151

154152
### Framework-provided assemblies win at runtime anyway
155153

‎.github/instructions/ado-pipelines.instructions.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ Key parameters:
4141
- `referenceType` (required) — `Package` or `Project`; controls how sibling packages are referenced
4242
- `buildConfiguration` (required) — `Debug` or `Release`
4343
- `testJobTimeout` (required) — test job timeout in minutes
44-
- `targetFrameworks` — Windows test TFMs; default `[net462, net8.0, net9.0, net10.0]`
45-
- `targetFrameworksUnix` — Unix test TFMs; default `[net8.0, net9.0, net10.0]`
44+
- `targetFrameworks` — Windows test TFMs; default `[net462, net10.0]`
45+
- `targetFrameworksUnix` — Unix test TFMs; default `[net10.0]`
4646
- `netcoreVersionTestUtils` — default runtime for shared test utilities; default `net10.0`
4747
- `testSets` — test partitions; default `[1, 2, 3]`
4848
- `useManagedSNI` — SNI variants to test; default `[false, true]`
@@ -71,14 +71,14 @@ When adding a new build stage, respect the dependency graph and pass artifact na
7171

7272
PR pipelines:
7373
- Trigger on PRs to `dev/*`, `feat/*`, `main`; exclude `eng/pipelines/onebranch/*` paths
74-
- Use reduced TFM matrix: `[net462, net8.0, net9.0]` (excludes net10.0)
74+
- Use `[net462, net10.0]` on Windows and `[net10.0]` on Unix
7575
- Timeout: 90 minutes
7676
- Package-ref PR disables Always Encrypted tests in Debug config and also disables legacy SQL Server test legs to keep validation fast
7777

7878
CI pipelines:
7979
- Trigger on push to `main` (GitHub) and `internal/main` (ADO) with `batch: true`
8080
- Scheduled weekday builds (see individual pipeline files for cron times)
81-
- Full TFM matrix including net10.0 test legs and legacy SQL Server manual-test coverage
81+
- Same supported TFM matrix as PR validation, with legacy SQL Server manual-test coverage
8282

8383
## Test Configuration
8484

‎.github/instructions/api-design.instructions.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ Microsoft.Data.SqlClient follows strict API design guidelines to ensure:
1515
### Structure
1616
```
1717
src/Microsoft.Data.SqlClient/
18-
├── netcore/ref/ # .NET Core/.NET public APIs
19-
│ └── Microsoft.Data.SqlClient.cs
20-
└── netfx/ref/ # .NET Framework public APIs
21-
└── Microsoft.Data.SqlClient.cs
18+
└── ref/ # Unified public API declarations
19+
├── Microsoft.Data.SqlClient.csproj
20+
├── Microsoft.Data.SqlClient.cs
21+
└── Microsoft.Data.SqlTypes.cs # Other namespace-specific files alongside
2222
```
2323

2424
### API Surface
@@ -32,8 +32,8 @@ The reference assemblies do **not** use C# nullable context (`#nullable enable`)
3232

3333
### Updating Public APIs
3434
When adding or modifying public APIs:
35-
1. Update reference assembly in BOTH `netcore/ref/` and `netfx/ref/`
36-
2. Ensure signatures match across platforms
35+
1. Update the corresponding sources under `src/Microsoft.Data.SqlClient/ref/`
36+
2. Ensure signatures match the implementation for each affected framework, including conditional declarations
3737
3. Add XML documentation
3838
4. Consider backward compatibility
3939
5. Do not use nullable annotations (`?`) in ref assemblies (see above)

0 commit comments

Comments
 (0)