Skip to content

fix(packaging): restore standalone serializer code generation - #11597

Merged
ReubenBond merged 3 commits into
dotnet:mainfrom
ReubenBond:rb-standalone-serializer-codegen
Oct 27, 2026
Merged

ReubenBond merged 3 commits into
dotnet:mainfrom
ReubenBond:rb-standalone-serializer-codegen

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Fixes #11582.

#10035 added ReferenceOutputAssembly="false" to the build-time analyzer project references. NuGet consequently omitted the code generator and analyzer package dependencies starting in 10.3.0, so Serialization-only consumers compiled attributed types but failed with CodecNotFoundException at runtime.

Use Private="false" on the packable analyzer references in packable projects instead. This preserves their include="All" NuGet dependencies while keeping analyzer assemblies out of copy-local outputs. Nonpackable projects retain their existing analyzer-reference metadata, allowing analyzer test projects to load their explicit runtime references. The shared packaging fix also restores generator delivery through standalone Core, Runtime, Streaming, and serializer-extension packages, and composes with SDK/Client/Server references.

Add isolated consumers of locally packed packages, gated in CI on .NET 8 and .NET 10. They verify codec round trips, deep-copy values and identity, exactly one generator/analyzer registration, and build-only analyzer outputs. Source mapping and a fresh NuGet cache ensure the consumers use the local Orleans packages; building outside the repository prevents repository imports from masking missing package assets. Clarify the package's generator guarantee in its README.

Microsoft Reviewers: Open in CodeFlow

Copilot AI balanced review requested due to automatic review settings October 27, 2026 20:41

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

The shared packaging change affects multiple dependency graphs, and successful end-to-end consumer validation has not been established by the available evidence.

No open issues 🎉

What changed in this PR

Restores source-generator and analyzer delivery for standalone Orleans packages, addressing the serialization regression reported in #11582.

Changes:

  • Preserves NuGet analyzer dependencies while keeping analyzer assemblies out of copy-local outputs.
  • Adds isolated package-consumer checks in CI for .NET 8 and .NET 10.
  • Documents automatic codec and copier generation for Serialization-only consumers.
File Description
src/​Orleans.Serialization/​README.md Clarifies the package’s generator and analyzer guarantee.
Directory.Build.targets Uses Private="false" to preserve analyzer package dependencies.
.github/​workflows/​ci.yml Runs package-consumer validation after Linux packaging.
.github/​scripts/​test-package-consumers.ps1 Tests serialization, copying, analyzer registration, and output isolation using local packages.

Review effort: Balanced

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

The shared packaging change needs confirmed package compatibility and consumer validation on both target frameworks before approval.

No open issues 🎉

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 27, 2026 20:59

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

The shared packaging change affects multiple package dependency graphs, and successful consumer and compatibility checks have not been confirmed.

No open issues 🎉

Review effort: Balanced

Preserve generator and analyzer NuGet dependencies with Private=false while keeping their assemblies out of copy-local outputs. ReferenceOutputAssembly=false unintentionally removed those dependencies in dotnet#10035.

Exercise isolated consumers of locally packed serialization, extension, runtime and metapackages, including combined references, on net8.0 and net10.0.
Restrict copy-local suppression to packable projects. Nonpackable projects retain their prior ReferenceOutputAssembly=false analyzer reference metadata, allowing CodeGenerator.Tests and Analyzers.Tests to load their explicit runtime references.
@ReubenBond
ReubenBond force-pushed the rb-standalone-serializer-codegen branch from 7bc74ff to 66afd9e Compare October 27, 2026 21:17
Copilot AI balanced review requested due to automatic review settings October 27, 2026 21:17

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

The shared packaging change affects dependency graphs across multiple packages, and successful compatibility and package-consumer validation has not been verified.

No open issues 🎉

Review effort: Balanced

@ReubenBond
ReubenBond merged commit 1e07e52 into dotnet:main Oct 27, 2026
94 checks passed
@ReubenBond
ReubenBond deleted the rb-standalone-serializer-codegen branch October 27, 2026 21:57
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.

Microsoft.Orleans.Serialization alone no longer generates codecs for [GenerateSerializer] types since 10.3.0

2 participants