Skip to content

Multi-target net8.0 and net10.0 - #7

Closed
henrikottesorensen wants to merge 1 commit into
Notalib:mainfrom
henrikottesorensen:feature/dotnet10-multitarget
Closed

Multi-target net8.0 and net10.0#7
henrikottesorensen wants to merge 1 commit into
Notalib:mainfrom
henrikottesorensen:feature/dotnet10-multitarget

Conversation

@henrikottesorensen

@henrikottesorensen henrikottesorensen commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

#6 has merged, so this now targets main directly and the diff is only this change.

LibLouis.NET and the test project build for both target frameworks.

Scope changed

This originally also moved the build container to sdk:10.0-noble. That has been dropped from this PR. The container compiles C and runs dotnet pack, and which SDK does the packing barely affects the output — these are netstandard2.0 metadata around an already-compiled binary, with IncludeBuildOutput off. The container's SDK now moves as part of the Dockerfile restructure that separates compiling from packing, where it belongs. This PR is purely the multi-targeting.

The change

The extensions packages are referenced per target framework — 8.0.2 for net8.0, 10.0.10 for net10.0 — so a net10 consumer does not drag an older set into its dependency graph. The package ends up with lib/net8.0/ and lib/net10.0/ and matching per-TFM dependency groups.

The runtime packages stay on netstandard2.0. They carry no managed code, and netstandard2.0 is the widest thing to be compatible with.

Microsoft.NET.Test.Sdk moves to 18.8.1, the first version supporting net10.0. setup-dotnet installs both SDKs.

A bug this change introduced, and its fix

Packing a multi-targeted project runs the cross-targeting outer build, which has no default None items. The existing <None Update="LICENSE"> therefore matched nothing there, and the licence silently never reached the package — NU5030, at pack time rather than build time. The inner builds do have the item, where a second Include would be a duplicate. Both forms are now present, conditioned on whether TargetFramework is set.

Worth knowing generally: Update on a multi-targeted project is a trap, because it behaves differently in the outer and inner builds.

Verified

Both target frameworks build and pass the tests, and the packed .nupkg carries both lib/ folders with the right dependency groups.

🤖 Generated with Claude Code

LibLouis.NET and the test project build for both.

The extensions packages are referenced per target framework, 8.0.2 for
net8.0 and 10.0.10 for net10.0, so a net10.0 consumer does not drag an
older set into its dependency graph. The runtime packages stay on
netstandard2.0: they carry no managed code, and netstandard2.0 is the
widest thing to be compatible with. Microsoft.NET.Test.Sdk moves to
18.8.1, the first version that supports net10.0.

Packing a multi-targeted project runs the cross-targeting outer build,
which has no default None items, so the existing <None Update="LICENSE">
matched nothing there and the licence silently never reached the package
(NU5030). The inner builds do have the item, where a second Include would
be a duplicate, so both forms are present and conditioned on whether
TargetFramework is set.

The container's own SDK version is deliberately not touched here. It
compiles C and runs dotnet pack, and which SDK does the packing barely
affects the output; moving it belongs with the Dockerfile restructure
that separates compiling from packing, not with the multi-targeting.

Verified: both target frameworks build and pass, and the package carries
lib/net8.0 and lib/net10.0 with matching per-TFM dependency groups.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@henrikottesorensen
henrikottesorensen force-pushed the feature/dotnet10-multitarget branch from e43267c to a83f932 Compare August 5, 2026 12:31
@henrikottesorensen henrikottesorensen changed the title Move to the .NET 10 SDK image and multi-target net8.0 and net10.0 Multi-target net8.0 and net10.0 Aug 5, 2026
@henrikottesorensen
henrikottesorensen changed the base branch from main to yaml-specs August 12, 2026 06:35
@henrikottesorensen
henrikottesorensen changed the base branch from yaml-specs to main August 12, 2026 06:35
@henrikottesorensen

Copy link
Copy Markdown
Collaborator Author

Superseded by #23.

The head branch has moved from the henrikottesorensen/LibLouis.NET fork onto Notalib/LibLouis.NET, because GitHub's stacked pull requests require the head and base branches to live in the same repository (gh-stack#46). No commits or content were changed in the move.

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.

2 participants