Skip to content

Commit 84c58b7

Browse files
Upgrade to .NET 10 and Microsoft.Data.SqlClient 6.x (#3656)
Joint runtime + driver bump to unblock two new SQL datatypes — **JSON** (#2768) and **Vector** (#2767). This is a no-behavior-change prerequisite PR. It does not implement JSON or Vector itself; it raises the runtime and driver floor so the companion feature PRs can compile and run. WHY BOTH BUMPS ARE REQUIRED TOGETHER ==================================== Two separate datatype features both depend on this baseline: 1. JSON (#2768) — needs the .NET 10 BCL enum value. SqlDbType.Json (numeric value 35) is a BCL enum value in System.Data, added in .NET 9 and present in .NET 10. It is NOT a Microsoft.Data.SqlClient symbol — SqlClient does not get to add values to a BCL enum it does not own. On .NET 8, the SqlDbType enum stops at DateTimeOffset = 34, so Enum.TryParse<SqlDbType>("json", ignoreCase: true, out _) in TypeHelper.GetSystemTypeFromSqlDbType returns false regardless of which SqlClient version is installed. The companion feature PR for #2768 plans to add a single dictionary entry [SqlDbType.Json] = typeof(string) which simply will not compile on net8.0. 2. Vector (#2767) — needs Microsoft.Data.SqlClient 6.1.x. The SqlVector type (extending System.Data.SqlTypes) was introduced in Microsoft.Data.SqlClient 6.1.0. DAB's current driver (5.2.3) has no such type, so vector columns/parameters cannot be discovered or round-tripped. The Vector foundation work (#3654, child of #2767) requires the driver to be on the 6.1.x line. This PR pins 6.1.5. Because JSON needs .NET 10 and Vector needs SqlClient 6.1.x, and both feature PRs build on the same baseline, both upgrades must land together as a single prerequisite. WHY .NET 10 AND NOT .NET 9 ========================== - .NET 10 is the current Long-Term Support release (Nov 2025+). - .NET 9 is Standard-Term Support, EOL May 2026. - DAB's current .NET 8 line reaches EOL November 2026. Going straight to LTS avoids a second forced upgrade inside 12 months. WHY SqlClient 6.1.x AND NOT 7.x =============================== 6.1.5 already delivers everything these features need: SqlVector (6.1) for Vector, and JSON support paired with the .NET 10 BCL SqlDbType.Json enum. 7.0 introduces a breaking change — the Azure auth stack (Azure.Core, Azure.Identity, Microsoft.Identity.Client) is extracted out of the core package into a separate Microsoft.Data.SqlClient.Extensions.Azure package — which would affect DAB's managed-identity / Entra ID auth paths and is out of scope for a no-behavior-change PR. Issue #3422's intent (get off the 2-versions-behind 5.2.3 line) is satisfied by 6.1.x. A move to 7.x is deferred to a dedicated follow-up. SCOPE OF CHANGES (NO BEHAVIOR CHANGE INTENDED) ============================================== Runtime / SDK pin: - global.json: 8.0.420 -> 10.0.301 Target framework (all 11 src/**/*.csproj): - net8.0 -> net10.0 NuGet packages (Directory.Packages.props): - Microsoft.Data.SqlClient 5.2.3 -> 6.1.5 - Microsoft.Extensions.Caching.Memory 8.0.1 -> 10.0.0 - Microsoft.Extensions.Caching.Abstractions 9.0.0 -> 10.0.0 - Microsoft.Extensions.Primitives 9.0.0 -> 10.0.0 - Microsoft.Extensions.Configuration.Binder 9.0.0 -> 10.0.0 - Microsoft.Extensions.Configuration.Json 9.0.0 -> 10.0.0 - Microsoft.Extensions.Caching.StackExchangeRedis 9.0.3 -> 10.0.0 The Microsoft.Extensions.* bumps are required because OpenTelemetry's transitive chain (Microsoft.Extensions.Logging.Configuration 10.0.0) demands Configuration.Binder >= 10.0.0 — staying on 9.0.0 produces NU1605 package-downgrade errors (warning-as-error). Service.csproj (Microsoft.NET.Sdk.Web) — drop now-redundant PackageReferences (NU1510, warning-as-error): - Microsoft.Extensions.Configuration.Binder (in shared framework) - Microsoft.Extensions.Configuration.Json (in shared framework) Azure DevOps pipelines (9 occurrences across 8 files): - UseDotNet@2 version: 8.0.x -> 10.0.x Container base images (Dockerfile): - mcr.microsoft.com/dotnet/sdk:8.0-cbl-mariner2.0 -> 10.0-azurelinux3.0 - mcr.microsoft.com/dotnet/aspnet:8.0-cbl-mariner2.0 -> 10.0-azurelinux3.0 (cbl-mariner2.0 tag does not exist for .NET 9+; Azure Linux 3.0 is Microsoft's documented successor.) Aspire AppHost (src/Aspire.AppHost/AppHost.cs): - WithArgs("-f", "net8.0") -> WithArgs("-f", "net10.0") (mssql + pg) Build/publish scripts: - scripts/publish.ps1: $dotnetTargetFrameworks net8.0 -> net10.0 - scripts/create-manifest-file.ps1: $dotnetTargetFrameworks + hashtable keys net8.0_{rid} -> net10.0_{rid} (TODO marker: release-engineering to confirm download URLs/hashes resolve) License file rename: - external_licenses/Microsoft.Data.SqlClient.SNI.5.2.0.License.txt -> external_licenses/Microsoft.Data.SqlClient.SNI.6.0.2.License.txt (SqlClient 6.1.5 depends on Microsoft.Data.SqlClient.SNI.runtime 6.0.2.) - scripts/notice-generation.ps1: path updated to match - TODO marker at top of license file: contents still 5.2.0 text; release-engineering to refresh from upstream before merge. SUPPRESSED ASPDEPR008 (warning-as-error) — DELIBERATE ===================================================== ASP.NET Core 10 deprecates IWebHostBuilder / IWebHost in favor of WebApplicationBuilder / IHost. Two locations in this repo still consume the obsolete types and would block compilation under the repo's TreatWarningsAsErrors=true setting: - src/Service/Program.cs (2 sites): test-only helpers CreateWebHostBuilder + CreateWebHostFromInMemoryUpdatableConfBuilder are consumed by the existing TestServer fixture which takes IWebHostBuilder. - src/Service.Tests/Configuration/ConfigurationTests.cs (3 sites): the consumer of those helpers. Migrating from WebHost to HostBuilder/WebApplicationBuilder is a behavior-affecting refactor and explicitly OUT OF SCOPE for this no-behavior-change prerequisite PR. Suppression is added at the project level (NoWarn=ASPDEPR008 on Service.csproj + Service.Tests.csproj) with an inline TODO comment pointing at this branch and a follow-up issue link placeholder. VALIDATION ========== dotnet --version : 10.0.301 dotnet restore --nologo : 11/11 projects restored dotnet build -c Debug : 0 warnings, 0 errors Multi-engine test categories (MsSql, PostgreSql, MySql, CosmosDb_NoSql, DwSql) were NOT run locally; they MUST run green on the Azure DevOps multi-engine matrix before this PR merges. That matrix is the gate. NEXT STEPS BEFORE MERGE ======================= 1. Release-engineering: refresh external_licenses/Microsoft.Data.SqlClient.SNI.6.0.2.License.txt from upstream for the SNI 6.0.2 version (currently still 5.2.0 text with a TODO marker at top). 2. Release-engineering: confirm scripts/create-manifest-file.ps1 net10.0_{linux,win,osx}-x64 download URLs and SHA hashes resolve once the .NET 10 publish cycle runs. 3. Multi-engine CI matrix runs green (MsSql, PostgreSql, MySql, CosmosDb_NoSql, DwSql) — that is the merge gate. 4. File follow-up issue for ASPDEPR008 migration (WebHost -> WebApplicationBuilder / IHost) so the NoWarn suppressions can be removed in a future behavior-changing PR. 5. File follow-up issue to evaluate Microsoft.Data.SqlClient 7.x (adds Microsoft.Data.SqlClient.Extensions.Azure, re-validate Entra ID / managed-identity auth). ## Why make this change? - Prerequisite for #2768 (JSON datatype support) and #2767 (Vector datatype support). - #2768: make MSSQL `JSON` a first-class DAB type; requires the .NET 10 BCL `SqlDbType.Json` enum value, which does not exist on net8.0. - #2767: make MSSQL `VECTOR` a first-class DAB type; requires the `SqlVector` type introduced in Microsoft.Data.SqlClient 6.1.0. - Also advances #3422 (get off the 2-major-versions-behind Microsoft.Data.SqlClient 5.2.3 line). ## What is this change? - Raises the runtime to .NET 10 (LTS) and the SQL driver to Microsoft.Data.SqlClient 6.1.5, plus the transitive Microsoft.Extensions.* bumps required to keep the build clean under warnings-as-errors. No runtime behavior is intended to change; the feature work for JSON (#2768) and Vector (#2767) lands in separate PRs on top of this baseline. ## How was this tested? - [x] Integration Tests (multi-engine CI matrix is the merge gate) - [x] Unit Tests ## Sample Request(s) - N/A — infrastructure/prerequisite PR; no API surface change. Feature-level REST/GraphQL samples will accompany the JSON (#2768) and Vector (#2767) feature PRs. --------- Co-authored-by: Ruben Cerna <rcernaserna@microsoft.com>
1 parent ed549fd commit 84c58b7

34 files changed

Lines changed: 136 additions & 89 deletions

.devcontainer/devcontainer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"name": ".NET 8",
3-
"image": "mcr.microsoft.com/dotnet/sdk:8.0",
2+
"name": ".NET 10",
3+
"image": "mcr.microsoft.com/dotnet/sdk:10.0",
44
"features": {
55
// https://github.com/devcontainers/features/tree/main/src/dotnet
66
"ghcr.io/devcontainers/features/dotnet:2": {
77
"version": "latest",
8-
"dotnetRuntimeVersions": "8.0",
9-
"aspNetCoreRuntimeVersions": "8.0",
10-
"additionalVersions": "8.0"
8+
"dotnetRuntimeVersions": "10.0",
9+
"aspNetCoreRuntimeVersions": "10.0",
10+
"additionalVersions": "10.0"
1111
}
1212
},
1313
"customizations": {

.github/copilot-instructions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Data API builder (DAB) is an open-source, no-code tool that creates secure, full
66

77
### Key Technologies
88
- **Language**: C# / .NET
9-
- **.NET Version**: .NET 8.0 (see `global.json`)
9+
- **.NET Version**: .NET 10.0 (see `global.json`)
1010
- **Supported Databases**: Azure SQL, SQL Server, SQLDW, Cosmos DB, PostgreSQL, MySQL
1111
- **API Types**: REST, GraphQL, MCP
1212
- **Deployment**: Cross-platform (Azure, AWS, GCP, on-premises)
@@ -36,7 +36,7 @@ data-api-builder/
3636
## Building and Testing
3737

3838
### Prerequisites
39-
- .NET 8.0 SDK or later
39+
- .NET 10.0 SDK or later
4040
- Database server for testing (SQL Server, PostgreSQL, MySQL, or Cosmos DB)
4141

4242
### Building the Project

.pipelines/cosmos-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ steps:
5454
# Per Microsoft Learn Docs, "Selecting the .NET SDK version is independent from
5555
# specifying the runtime version a project targets."
5656
- task: UseDotNet@2
57-
displayName: Setup .NET SDK v8.0.x
57+
displayName: Setup .NET SDK v10.0.x
5858
inputs:
5959
packageType: sdk
60-
version: 8.0.x
60+
version: 10.0.x
6161
installationPath: $(Agent.ToolsDirectory)/dotnet
6262

6363
- task: NuGetToolInstaller@1

.pipelines/dwsql-pipelines.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ jobs:
4747
# Per Microsoft Learn Docs, "Selecting the .NET SDK version is independent from
4848
# specifying the runtime version a project targets."
4949
- task: UseDotNet@2
50-
displayName: Setup .NET SDK v8.0.x
50+
displayName: Setup .NET SDK v10.0.x
5151
inputs:
5252
packageType: sdk
53-
version: 8.0.x
53+
version: 10.0.x
5454

5555
- task: NuGetToolInstaller@1
5656

@@ -176,10 +176,10 @@ jobs:
176176
# Per Microsoft Learn Docs, "Selecting the .NET SDK version is independent from
177177
# specifying the runtime version a project targets."
178178
- task: UseDotNet@2
179-
displayName: Setup .NET SDK v8.0.x
179+
displayName: Setup .NET SDK v10.0.x
180180
inputs:
181181
packageType: sdk
182-
version: 8.0.x
182+
version: 10.0.x
183183

184184
- task: NuGetToolInstaller@1
185185

.pipelines/mssql-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ jobs:
4949
# Per Microsoft Learn Docs, "Selecting the .NET SDK version is independent from
5050
# specifying the runtime version a project targets."
5151
- task: UseDotNet@2
52-
displayName: Setup .NET SDK v8.0.x
52+
displayName: Setup .NET SDK v10.0.x
5353
inputs:
5454
packageType: sdk
55-
version: 8.0.x
55+
version: 10.0.x
5656

5757
- task: NuGetToolInstaller@1
5858

.pipelines/mysql-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ jobs:
4646
# Per Microsoft Learn Docs, "Selecting the .NET SDK version is independent from
4747
# specifying the runtime version a project targets."
4848
- task: UseDotNet@2
49-
displayName: Setup .NET SDK v8.0.x
49+
displayName: Setup .NET SDK v10.0.x
5050
inputs:
5151
packageType: sdk
52-
version: 8.0.x
52+
version: 10.0.x
5353

5454
- task: NuGetToolInstaller@1
5555

.pipelines/pg-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ jobs:
4141
# Per Microsoft Learn Docs, "Selecting the .NET SDK version is independent from
4242
# specifying the runtime version a project targets."
4343
- task: UseDotNet@2
44-
displayName: Setup .NET SDK v8.0.x
44+
displayName: Setup .NET SDK v10.0.x
4545
inputs:
4646
packageType: sdk
47-
version: 8.0.x
47+
version: 10.0.x
4848

4949
- task: NuGetToolInstaller@1
5050

.pipelines/templates/build-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ steps:
5454
# Per Microsoft Learn Docs, "Selecting the .NET SDK version is independent from
5555
# specifying the runtime version a project targets."
5656
- task: UseDotNet@2
57-
displayName: Setup .NET SDK v8.0.x
57+
displayName: Setup .NET SDK v10.0.x
5858
inputs:
5959
packageType: sdk
60-
version: 8.0.x
60+
version: 10.0.x
6161
installationPath: $(Agent.ToolsDirectory)/dotnet
6262

6363
- task: NuGetToolInstaller@1

.pipelines/templates/mssql-test-steps.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ steps:
3131
# Per Microsoft Learn Docs, "Selecting the .NET SDK version is independent from
3232
# specifying the runtime version a project targets."
3333
- task: UseDotNet@2
34-
displayName: Setup .NET SDK v8.0.x
34+
displayName: Setup .NET SDK v10.0.x
3535
inputs:
3636
packageType: sdk
37-
version: 8.0.x
37+
version: 10.0.x
3838

3939
- task: NuGetToolInstaller@1
4040

.pipelines/templates/static-tools.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
clean: true # if true, execute `execute git clean -ffdx && git reset --hard HEAD` before fetching
2222

2323
- task: UseDotNet@2
24-
displayName: Setup .NET SDK v8.0.x
24+
displayName: Setup .NET SDK v10.0.x
2525
inputs:
2626
packageType: sdk
27-
version: 8.0.x
27+
version: 10.0.x
2828

2929
# Analyze source and build output text files for credentials
3030
- task: CredScan@3

0 commit comments

Comments
 (0)