Repository navigation
Depend on the source generator package instead of bundling it - #79
Merged
Merged
Conversation
Client and Server each carried a copy of Cocoar.SignalARRR.SourceGenerator.dll under analyzers/dotnet/cs. A project referencing both ran the generator twice, generated every proxy twice and failed with duplicate type errors. Both now depend on the Cocoar.SignalARRR.SourceGenerator package, which NuGet resolves once. NuGet drops ProjectReferences with ReferenceOutputAssembly=false from a package's dependencies, so the generator is referenced as an assembly with Private=false (kept out of output and package) and PrivateAssets=compile;runtime (analyzer flows, compile reference does not). MSB3277 from the generator's Roslyn dependencies is silenced in these two projects only; consumers never resolve the generator as an assembly. Docs no longer describe the generator as part of Contracts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
windischb
force-pushed
the
claude/signalarr-packaging-error-f9427f
branch
from
September 25, 2026 11:35
78e22d2 to
fa0a750
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Cocoar.SignalARRR.ClientandCocoar.SignalARRR.Servereach bundled a copy ofCocoar.SignalARRR.SourceGenerator.dllunderanalyzers/dotnet/cs. A project that references both (typically an ASP.NET integration test project) ran the generator twice. Every proxy was generated twice and the build failed with CS0101/CS0111.Fix
Cocoar.SignalARRR.SourceGeneratorpackage, which is already published with every release. NuGet resolves that package once, so only one generator runs.ReferenceOutputAssembly="false"out of the package dependencies, so the generator is now referenced as an assembly:Private="false"keeps it out of the build output and the package.PrivateAssets="compile;runtime"lets the analyzer flow to consumers without passing on a compile reference, including to the projects in this repo that reference Client or Server.System.Collections.Immutablevs net8.0's) is silenced in Client and Server only. Consumers never resolve the generator as an assembly, so they don't see it.Contractsget no generator, as before.Verification
Cocoar.SignalARRR.SourceGenerator(include="…Analyzers…") and contain no DLL copy.🤖 Generated with Claude Code