Skip to content

Upgrade to .NET 10 - #1

Merged
scegg merged 2 commits into
masterfrom
upgrade/net10
Aug 15, 2026
Merged

Upgrade to .NET 10#1
scegg merged 2 commits into
masterfrom
upgrade/net10

Conversation

@scegg

@scegg scegg commented Aug 15, 2026

Copy link
Copy Markdown
Member

Moves from .NET Framework 4.8.1 to net10.0-windows, keeping Windows Forms. The database engine is deliberately left on SQL Server so that any breakage here is unambiguously the framework change.

What changed

  • csproj is now SDK-style. Files no longer have to be hand-added to build.
  • The six committed dlls are gone. Upstream Shipwreck.Phash 0.5.0 exposes the same four GetCrossCorrelation overloads the fork was kept for — verified by reflecting over both assemblies — and the other four are part of the BCL on .NET 10.
  • System.Data.SqlClientMicrosoft.Data.SqlClient across 59 files. Only the using line moves; every SqlDbType use was already written as System.Data.SqlDbType.*, and that enum is unchanged.
  • Assembly.CodeBaseAppContext.BaseDirectory (obsolete on .NET 5+).
  • SHA1ManagedSHA1.Create() (SYSLIB0021). Same algorithm, same output.
  • Assembly metadata moved into the csproj. Not cosmetic: with GenerateAssemblyInfo disabled the SDK also omits SupportedOSPlatform("windows") for a -windows TFM, which made every WinForms call report CA1416 — 1542 warnings.
  • DefaultValue on three UserControl properties (WFO1000).

Breaking change

Windows PowerShell 5.1 can no longer load this module — it runs on .NET Framework. v2026.08.15.2 remains the last release that loads under 5.1.

The minimum is PowerShell 7.6, not merely "7.x": 7.6 is the first release built on .NET 10, and an older pwsh cannot load a net10.0 assembly. System.Management.Automation 7.6.5 targets net10.0, confirming the floor.

pwsh defaults to STA on Windows, so the WinForms cmdlets keep working without threading changes. VS Code's PowerShell Integrated Console runs MTA and is the exception.

Packaging

ExcludeAssets="runtime;native" on System.Management.Automation. Excluding only runtime still shipped the host's native payload — pwrshplugin.dll, PowerShell.Core.Instrumentation.dll, and libpsl-native.so/.dylib for Linux and macOS in a Windows-only module. Removing it dropped the package from 78 files to 42.

The workflow now packages the whole publish tree rather than flat *.dll, because ImageStore.deps.json drives dependency resolution and SqlClient's native SNI library lives under runtimes/<rid>/native. Flattening produces a module that loads and then fails on first connect.

The package grows to ~11 MB; Microsoft.Data.SqlClient pulls in Azure.Identity and friends. It shrinks again when SQLite replaces it.

Verification

  • Built and published locally via EnableWindowsTargeting0 warnings, 0 errors. Worth noting the repo could be built on Linux all along; that is how the native-payload leak was found.
  • CI green on real Windows; Publish release correctly skipped for the PR.
  • The artifact was downloaded and asserted: all required files present, native SNI present, no banned host payload, no .pdb.

Not verified, and CI cannot cover it: Import-Module under a real pwsh, a database round-trip, and the two interactive WinForms cmdlets. Those need a Windows box with SQL Server before this is tagged as a release.

🤖 Generated with Claude Code

scegg and others added 2 commits August 15, 2026 17:20
Moves from .NET Framework 4.8.1 to net10.0-windows, keeping Windows Forms.
The database engine is deliberately untouched so that any breakage is
unambiguously the framework change.

The csproj becomes SDK-style, so files no longer have to be hand-listed. The
six dlls committed under ImageStore/ are gone: upstream Shipwreck.Phash 0.5.0
turns out to expose the same GetCrossCorrelation overloads the fork was kept
for, and the other four are part of the BCL on .NET 10.

Assembly metadata moves into the csproj. That is not cosmetic — with
GenerateAssemblyInfo disabled the SDK also omits SupportedOSPlatform("windows")
for a -windows TFM, and every WinForms call then reports CA1416.

System.Management.Automation is referenced with ExcludeAssets="runtime;native".
Excluding only runtime still ships the host's native payload, including
libpsl-native for Linux and macOS in a Windows-only module.

Consequence: Windows PowerShell 5.1 can no longer load the module, since it
runs on .NET Framework. v2026.08.15.2 remains the last release for 5.1 users.

Also adds a pull_request trigger that builds without publishing, so a change
this size can be verified before it reaches master.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
README gains a requirements section and switches to pwsh. The minimum is
PowerShell 7.6, not just "7 or later": 7.6 is the first release built on
.NET 10, and an older pwsh cannot load a net10.0 assembly.

Also documents that the two window-opening cmdlets need STA, which pwsh
provides by default but VS Code's Integrated Console does not, and that the
archive has to be unpacked as a whole because the module now ships with its
dependency tree.

Drops the fork attribution for phash. CLAUDE.md is rewritten where it went
stale: the rule about hand-adding files to the csproj is gone with the legacy
project format, and the claim that this cannot be built on Linux was wrong
enough to matter -- EnableWindowsTargeting builds and publishes fine there,
which is how the native-payload leak was caught.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@scegg
scegg merged commit 7b51a61 into master Aug 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant