Repository navigation
fix(deps): bump SourceGenerator.Foundations to 2.0.17 - #436
Merged
Merged
Conversation
SGF up to 2.0.16 registers loaded assemblies by simple name. A compiler server keeps every analyzer it ever loaded, so once it held a Facet of 6.6.8 or older (no SGF), the name "Facet" was taken: 6.6.9+ never unpacked its embedded assemblies, GenerateDtosGeneratorHoist failed with CS8784, and the DTOs were not generated (CS0246 where they are used). 2.0.17 resolves by name and version (SGF#74, Tim-Maes#76, Tim-Maes#77). Both packages move together: the hoist compiled into Facet.dll and the embedded Contracts come from the same release. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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
On a machine that builds more than one solution,
[GenerateDtos]can fail to run at all:The trigger is the compiler server (
VBCSCompiler), which keeps every analyzer it ever loaded. Once it holds a Facet of 6.6.8 or older (no SourceGenerator.Foundations, e.g. from another solution), the SGF resolver in 6.6.9+ sees the name "Facet" already registered. It matched on simple name only, so it never unpacks Facet's embedded assemblies, includingSourceGenerator.Foundations.Contracts.The failure depends on load order: new Facet first, then old, is clean. It also stays until the compiler server restarts, and CI never sees it because every build starts a fresh process. Projects that don't use
[GenerateDtos]only get the warning; projects that do also lose the generated DTOs.Fix
SourceGenerator.Foundations 2.0.17 resolves embedded assemblies by name and version, and its resource fallback now works (ByronMayne/SourceGenerator.Foundations#74, #76, #77). This PR bumps both SGF packages in one change, so the hoist compiled into
Facet.dlland the embedded Contracts always come from the same release. It also adds a changelog entry.Supersedes #434 and #435: Dependabot's version bumps, one package each.
Verification
Locally, .NET SDK 10.0.300, Release, as in CI:
master, no new warnings.Facet.Tests: 985/985.Facet.dllembedsSourceGenerator.Foundations.Contracts, Version=2.0.17.0and contains the new resolver.End-to-end, each row uses a dedicated compiler server (
-p:SharedCompilationId=…), with a project on Facet 6.6.8 built first and then a project that uses[GenerateDtos]:🤖 Generated with Claude Code