Skip to content

Filter SDK-generated friend assembly attributes - #2825

Merged
DavidObando merged 2 commits into
mainfrom
fix/issue-2816
Jul 28, 2026
Merged

Filter SDK-generated friend assembly attributes#2825
DavidObando merged 2 commits into
mainfrom
fix/issue-2816

Conversation

@DavidObando

Copy link
Copy Markdown
Owner

Summary

  • classify InternalsVisibleTo attributes by source provenance before emitting AssemblyInfo.gs
  • skip SDK-generated obj assembly attributes already reproduced from preserved MSBuild items
  • verify SDK-derived and hand-authored friend declarations each appear exactly once in compiled metadata

Tests

  • dotnet test tools/cs2gs/Cs2Gs.Tests/Cs2Gs.Tests.csproj --filter FullyQualifiedName~Cs2Gs.Tests.MigrationPipelineTests --no-restore --verbosity minimal (12 passed)
  • dotnet test tools/cs2gs/Cs2Gs.Tests/Cs2Gs.Tests.csproj --no-build --no-restore --verbosity minimal (1788 passed)

Fixes #2816

DavidObando added 2 commits July 27, 2026 21:39
Emit InternalsVisibleTo annotations only for attributes backed by translated source documents, leaving SDK-generated obj AssemblyInfo attributes to the preserved MSBuild items. Verify SDK and hand-authored declarations each appear once in compiled metadata.
Keep hand-authored InternalsVisibleTo annotations in translated source, preserve SDK-generated declarations only for diagnostic projects, and reproduce generated friend items in repository test parity projects.
@DavidObando
DavidObando merged commit 71a7964 into main Jul 28, 2026
10 checks passed
@DavidObando
DavidObando deleted the fix/issue-2816 branch July 28, 2026 05:55
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.

cs2gs: EmitFriendAssemblyAnnotations double-emits InternalsVisibleTo sourced from MSBuild items

1 participant