Skip to content

feat: prepare support for .NET 11 - #1569

Merged
vbreuss merged 1 commit into
mainfrom
feat/net11-support
Nov 4, 2026
Merged

vbreuss merged 1 commit into
mainfrom
feat/net11-support

Conversation

@vbreuss

@vbreuss vbreuss commented Nov 4, 2026

Copy link
Copy Markdown
Member

Testably.Abstractions.FileSystem.Interface 11.0.0-pre.1 only exposes the new hard link and null handle APIs on net11.0, so the target is needed to keep parity with the BCL. MockFileSystem cannot model hard links or provide a SafeFileHandle yet, so the mocks throw NotSupportedException.

Copilot AI balanced review requested due to automatic review settings November 4, 2026 18:28
@vbreuss vbreuss changed the title feat: support .NET 11 feat: prepare support for .NET 11 Nov 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The prerelease dependency triggers NU5104 when packing stable releases, and warnings-as-errors causes the stable release build to fail.

1 open issue
What changed in this PR

Prepares System.IO.Abstractions for .NET 11, exposing the new hard-link and null-handle APIs while preserving explicit unsupported behavior in the in-memory mocks.

Changes:

  • Adds the .NET 11 target, SDK selection, feature flags, and interface dependency.
  • Adds abstract APIs, BCL wrappers, and mock implementations that throw NotSupportedException.
  • Adds .NET 11 API baselines and parity snapshots.
File Description
tests/​TestableIO.System.IO.Abstractions.Parity.Tests/​ApiParityTests.cs Selects .NET 11 parity snapshots.
tests/​TestableIO.System.IO.Abstractions.Parity.Tests/​__snapshots__/​ApiParityTests.Path_.NET 11.0.snap Records Path parity.
tests/​TestableIO.System.IO.Abstractions.Parity.Tests/​__snapshots__/​ApiParityTests.FileVersionInfo_.NET 11.0.snap Records FileVersionInfo parity.
tests/​TestableIO.System.IO.Abstractions.Parity.Tests/​__snapshots__/​ApiParityTests.FileSystemWatcher_.NET 11.0.snap Records FileSystemWatcher parity.
tests/​TestableIO.System.IO.Abstractions.Parity.Tests/​__snapshots__/​ApiParityTests.FileInfo_.NET 11.0.snap Records FileInfo parity.
tests/​TestableIO.System.IO.Abstractions.Parity.Tests/​__snapshots__/​ApiParityTests.File_.NET 11.0.snap Records File parity.
tests/​TestableIO.System.IO.Abstractions.Parity.Tests/​__snapshots__/​ApiParityTests.DriveInfo_.NET 11.0.snap Records DriveInfo parity.
tests/​TestableIO.System.IO.Abstractions.Parity.Tests/​__snapshots__/​ApiParityTests.DirectoryInfo_.NET 11.0.snap Records DirectoryInfo parity.
tests/​TestableIO.System.IO.Abstractions.Parity.Tests/​__snapshots__/​ApiParityTests.Directory_.NET 11.0.snap Records Directory parity.
tests/​TestableIO.System.IO.Abstractions.Api.Tests/​Expected/​TestableIO.System.IO.Abstractions.Wrappers_net11.0.txt Adds the wrapper API baseline.
tests/​TestableIO.System.IO.Abstractions.Api.Tests/​Expected/​TestableIO.System.IO.Abstractions.TestingHelpers_net11.0.txt Adds the mock API baseline.
tests/​Directory.Build.props Adds the .NET 11 test target.
src/​TestableIO.System.IO.Abstractions.Wrappers/​FileWrapper.cs Delegates hard-link and null-handle operations to the BCL.
src/​TestableIO.System.IO.Abstractions.Wrappers/​FileInfoWrapper.cs Delegates hard-link creation to FileInfo.
src/​TestableIO.System.IO.Abstractions.Wrappers/​FileInfoBase.cs Declares the hard-link API.
src/​TestableIO.System.IO.Abstractions.Wrappers/​FileBase.cs Declares hard-link and null-handle APIs.
src/​TestableIO.System.IO.Abstractions.TestingHelpers/​Properties/​Resources.resx Adds unsupported-operation messages.
src/​TestableIO.System.IO.Abstractions.TestingHelpers/​MockFileInfo.cs Rejects mock FileInfo hard-link creation.
src/​TestableIO.System.IO.Abstractions.TestingHelpers/​MockFile.cs Rejects mock hard-link and null-handle operations.
src/​TestableIO.System.IO.Abstractions.TestingHelpers/​CommonExceptions.cs Centralizes the new exceptions.
src/​Directory.Build.props Adds the .NET 11 library target.
global.json Selects the .NET 11 prerelease SDK.
Directory.Packages.props Updates the interface dependency.
Directory.Build.props Enables existing and new features for .NET 11.
.github/​workflows/​ci.yml Installs the SDK selected by global.json.
.github/​workflows/​build.yml Installs the selected SDK for testing and packaging.

Review effort: Balanced

Comment thread Directory.Packages.props Resolved
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Test Results

    40 files  +    9      40 suites  +9   16s ⏱️ +2s
 1 177 tests +    2   1 176 ✅ +    2      1 💤 ±  0  0 ❌ ±0 
14 732 runs  +3 435  13 616 ✅ +3 158  1 116 💤 +277  0 ❌ ±0 

Results for commit 95c932d. ± Comparison against base commit ef6123f.

♻️ This comment has been updated with latest results.

Testably.Abstractions.FileSystem.Interface 11.0.0-pre.1 only exposes the new hard link and null handle APIs on net11.0, so the target is needed to keep parity with the BCL. MockFileSystem cannot model hard links or provide a SafeFileHandle yet, so the mocks throw NotSupportedException.
@vbreuss
vbreuss force-pushed the feat/net11-support branch from c7e59bb to 95c932d Compare November 4, 2026 19:14
@sonarqubecloud

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)
10.0% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@vbreuss
vbreuss enabled auto-merge (squash) November 4, 2026 19:19
@mergify

mergify Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@vbreuss
vbreuss merged commit 50c8f17 into main Nov 4, 2026
11 of 12 checks passed
@vbreuss
vbreuss deleted the feat/net11-support branch November 4, 2026 19:20
@github-actions

Copy link
Copy Markdown

This is addressed in release v23.0.0.

@github-actions github-actions Bot added the state: released Issues that are released label Nov 10, 2026
This was referenced Nov 11, 2026
This was referenced Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state: released Issues that are released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants