Skip to content

[dotnet-linker] Escape explicit interface member names - #26529

Open
rolfbjarne wants to merge 1 commit into
mainfrom
dev/rolf/devops-3057591
Open

[dotnet-linker] Escape explicit interface member names#26529
rolfbjarne wants to merge 1 commit into
mainfrom
dev/rolf/devops-3057591

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

Use documentation-comment escaping for explicit-interface properties and events when generating DynamicDependency attributes. This prevents first-build IL2037 warnings when the member name contains dots.

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/3057591.

Copilot-Session: a6097bb2-1e91-4dd7-ab9b-fa4a7ab070a0

Use documentation-comment escaping for explicit-interface properties and events when generating DynamicDependency attributes. This prevents first-build IL2037 warnings when the member name contains dots.

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/3057591.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a6097bb2-1e91-4dd7-ab9b-fa4a7ab070a0
Copilot AI lite review requested due to automatic review settings September 2, 2026 07:28

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.

🟢 Approval recommended

The change is localized, aligns with existing signature-generation patterns, and includes a targeted regression test for the reported warning scenario.

Pull request overview

This PR updates the dotnet-linker’s DynamicDependency generation to correctly escape explicit-interface property and event member names (replacing . with #) so the trimmer doesn’t emit first-build IL2037 warnings when member names contain dots.

Changes:

  • Extend DocumentationComments.GetSignature to support PropertyDefinition and EventDefinition, applying doc-comment escaping.
  • Update AppBundleRewriter to use the escaped signatures for properties/events when generating per-member DynamicDependencyAttributes.
  • Add a regression test ensuring explicit-interface property/event signatures are emitted escaped and contain no ..
File summaries
File Description
tools/dotnet-linker/DocumentionComments.cs Adds signature helpers for properties/events and escapes explicit-interface member name dots.
tools/dotnet-linker/AppBundleRewriter.cs Switches property/event DynamicDependency member signatures to use the escaping helper.
tests/assembly-preparer/ApplyPreserveAttributeTests.cs Adds coverage verifying escaped signatures for explicit-interface properties/events.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread tools/dotnet-linker/AppBundleRewriter.cs
Comment thread tools/dotnet-linker/DocumentionComments.cs
@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 44dc8b5640191ed879cb725614a083ebc6f9e70a [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne rolfbjarne added the ready-to-review This PR is ready to review/merge. label Sep 2, 2026
@rolfbjarne
rolfbjarne enabled auto-merge (squash) September 2, 2026 11:21
@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #44dc8b5] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 264 tests passed 🎉

Tests counts

✅ assembly-processing: All 1 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 7 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 31 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 31 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 31 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 25 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 25 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 20 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 25 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: 44dc8b5640191ed879cb725614a083ebc6f9e70a [PR build]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copilot ready-to-review This PR is ready to review/merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants