Skip to content

chore(build)!: target .NET 10 and .NET 11 - #866

Open
Gavin Barron (gavinbarron) wants to merge 6 commits into
mainfrom
gavinbarron-net10-and-net11-upgrade
Open

Gavin Barron (gavinbarron) wants to merge 6 commits into
mainfrom
gavinbarron-net10-and-net11-upgrade

Conversation

@gavinbarron

@gavinbarron Gavin Barron (gavinbarron) commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Replace explicit .NET 8 assets with .NET 10 and .NET 11 assets, including browser targets, and require the .NET 11 SDK.
  • Upgrade the HTTP library's .NET Framework target from net462 to net481, retaining its existing WinHTTP implementation and dependency.
  • Preserve both existing netstandard2.0 and netstandard2.1 targets.
  • Run modern CI tests and coverage on .NET 11 only; retarget the .NET Framework tests and CI run to .NET Framework 4.8.1. Simplify trimming/AOT validation to .NET 11 with unconditional publish properties.
  • Preserve the v1-to-v2 upgrade guide and add docs/upgrade-guide-v2-to-v3.md.
  • Align JSON generated public API annotations and precise decimal test expectations with .NET 11; apply existing Framework-specific serialization expectations to net481.
  • Merge main and retain its SonarCloud workflow removal, resolving the conflict.

Breaking changes

Explicit net8.0 and net8.0-browser assets are removed. Modern assets target .NET 10 and .NET 11. The HTTP library's framework-specific target changes from net462 to net481; its WinHTTP behavior is preserved. Both .NET Standard targets remain supported for compatible consumers. Building the repository requires the .NET 11 SDK.

Validation

  • Solution build with net481 and both .NET Standard targets: zero warnings or errors.
  • All net481 test assemblies passed after updating two existing NET472-only serialization assertions to NETFRAMEWORK.
  • Verified HTTP package contains net481 assets and no net462 assets.
  • Formatting verification passed.
  • Prior review revision: .NET 11 suite 902 passed; all eight library packages include netstandard2.1 assets.

Update framework targets, SDK selection, CI, and upgrade documentation. Align JSON generated API annotations and decimal test expectations with modern .NET.

BREAKING CHANGE: Remove explicit net8.0 and net8.0-browser targets. Modern .NET assets now target net10.0 and net11.0, and building the repository requires the .NET 11 SDK. Existing .NET Standard and .NET Framework targets remain supported.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@gavinbarron
Gavin Barron (gavinbarron) requested a review from a team as a code owner November 13, 2026 23:10
Copilot AI balanced review requested due to automatic review settings November 13, 2026 23:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human validation is needed for browser execution, trimmed/AOT publication, and compatibility after removing .NET 8 assets, since reported desktop checks do not cover these paths.

No open issues 🎉

What changed in this PR

Updates Kiota’s modern .NET targets to .NET 10 and .NET 11, removing explicit .NET 8 assets while retaining .NET Standard and .NET Framework support.

Changes:

  • Retargets libraries, browser assets, tests, and trimming validation.
  • Requires the .NET 11 SDK and updates CI, debugging configuration, and migration guidance.
  • Aligns generated JSON API annotations and uses exact, culture-independent decimal test expectations.
File Description
tests/​trimming/​Microsoft.Kiota.Trimming.Validation/​Microsoft.Kiota.Trimming.Validation.csproj Retargets trimming validation to .NET 10/11.
tests/​serialization/​json/​JsonParseNodeTests.cs Replaces floating-point-derived decimal expectations with exact parsed values.
tests/​Directory.Build.props Updates shared test targets, retaining .NET Framework 4.7.2.
src/​serialization/​json/​PublicAPI.Shipped.txt Aligns generated metadata API nullability annotations.
src/​serialization/​json/​Microsoft.Kiota.Serialization.Json.csproj Suppresses RS0041 for generated metadata on .NET 10.
src/​http/​httpClient/​Microsoft.Kiota.Http.HttpClientLibrary.csproj Updates HTTP library targets, including browser assets.
src/​Directory.Build.props Updates library targets, trimming/AOT conditions, and API analyzer targeting.
global.json Requires the .NET 11 SDK.
docs/​upgrade-guide-v1-to-v2.md Documents target changes and SDK requirements.
.vscode/​launch.json Points the debugger to the .NET 10 test assembly.
.github/​workflows/​sonarcloud.yml Adds the .NET 11 SDK for analysis builds.
.github/​workflows/​build-and-test.yml Updates SDK installation and adds .NET 11 tests.
.azure-pipelines/​ci-build.yml Adds the .NET 11 SDK and test execution.

Review effort: Balanced

@sonarqubecloud

Copy link
Copy Markdown

@github-code-quality

github-code-quality Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Code coverage overview

Languages: C#

C# / code-coverage/dotnet

main b9a5c36 gavinbarron-net10-an... e441ad2 +/-
85% 85% 0%
View coverage of the 4 most impacted files.
File main b9a5c36 gavinbarron-net10-an... e441ad2 +/-
D:\a\kiota-dotn...lientBuilder.cs 89% 89% 0%
D:\a\kiota-dotn...questAdapter.cs 72% 72% 0%
D:\a\kiota-dotn...odingHandler.cs 100% 100% 0%
D:\a\kiota-dotn...otaVersion.g.cs 0% 100% +100%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated November 17, 2026 13:34 UTC

Comment thread .azure-pipelines/ci-build.yml Resolved
Comment thread .github/workflows/build-and-test.yml Resolved
Comment thread docs/upgrade-guide-v1-to-v2.md Resolved
@github-project-automation github-project-automation Bot moved this to In Progress 🚧 in Kiota Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has conflicting changes, the author must resolve the conflicts before this pull request can be merged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Run modern CI tests and trimming validation on .NET 11 only. Preserve the v2 migration guide and document framework changes in a new v3 guide. Remove obsolete WinHTTP code and validate the .NET Standard fallback on .NET Framework.

BREAKING CHANGE: Remove explicit netstandard2.1 and HTTP net462 assets. Compatible consumers fall back to netstandard2.0; the HTTP factory uses HttpClientHandler instead of WinHttpHandler on .NET Framework.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 21:28
@github-actions

Copy link
Copy Markdown
Contributor

Conflicts have been resolved. A maintainer will take a look shortly.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The upgrade guide omits .NET 8/9 date/time migration options and the redirect-header callback needed to preserve proxy authentication safely with a custom WinHttpHandler.

2 open issues

Review effort: Balanced

Comment thread docs/upgrade-guide-v2-to-v3.md Resolved
Comment thread docs/upgrade-guide-v2-to-v3.md Resolved
Preserve the existing .NET Standard 2.1 assets and dependency conditions. Correct the v3 upgrade guide to reflect that .NET Standard targets remain unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 22:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Custom WinHttpHandler redirects can incorrectly lose explicit Proxy-Authorization headers and trigger HTTP 407 responses, while the migration guide omits the scrubber configuration needed to preserve them safely.

1 open issue
1 previously missed issue

In code that hasn't changed since last review

Medium severity Custom WinHTTP proxy auth headers are stripped on redirects

src/​http/​httpClient/​Middleware/​RedirectHandler.cs:219

For a custom WinHttpHandler, removing this branch makes Kiota strip an explicit Proxy-Authorization header even when a redirect uses the same proxy, potentially causing HTTP 407 responses. Supplying the custom handler as advised in docs/upgrade-guide-v2-to-v3.md:27 is therefore insufficient for these callers. Either support custom proxy resolution or document and test a ScrubSensitiveHeaders callback that calls DefaultScrubSensitiveHeaders with the handler's proxy resolver, preserving proxy-bypass and origin/proxy-change checks.

1 resolved since last review

Review effort: Balanced

Restore the framework-specific WinHTTP implementation and dependency. Retarget Framework tests and CI to net481 and preserve Framework-specific numeric serialization expectations.

BREAKING CHANGE: The HTTP library now targets net481 instead of net462. Both .NET Standard targets remain available for compatible older consumers.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 22:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block approval of the .NET target-framework transition.

1 open issue

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has conflicting changes, the author must resolve the conflicts before this pull request can be merged.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the .NET framework-baseline update.

1 open issue

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Conflicts have been resolved. A maintainer will take a look shortly.

@baywet Vincent Biret (baywet) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gavin Barron (@gavinbarron) make sure you include #872 and #873 in this PR as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress 🚧

Development

Successfully merging this pull request may close these issues.

4 participants