Skip to content

Consolidate interop generator docs into skill and cswinrtgen/#2361

Merged
Sergio0694 merged 2 commits intostaging/3.0from
docs/consolidate-interop-generator-docs
Mar 22, 2026
Merged

Consolidate interop generator docs into skill and cswinrtgen/#2361
Sergio0694 merged 2 commits intostaging/3.0from
docs/consolidate-interop-generator-docs

Conversation

@Sergio0694
Copy link
Copy Markdown
Member

Summary

Consolidate the interop generator documentation by integrating the Overview and Build Infrastructure sections from docs/winrt-interop-dll-spec.md into the interop generator skill, and moving the remaining name mangling scheme specification into docs/cswinrtgen/.

Motivation

The docs/winrt-interop-dll-spec.md file was written before the interop generator skill (SKILL.md) existed and contained information that was partially redundant. This PR consolidates all interop generator context into the skill (where it's most useful for Copilot), moves the name mangling scheme to live alongside the other design docs in docs/cswinrtgen/, and removes the now-superseded spec document.

Changes

  • docs/winrt-interop-dll-spec.mddocs/cswinrtgen/name-mangling-scheme.md: Moved and refocused — now contains only the name mangling scheme specification (verified accurate against the InteropUtf8NameFactory implementation). Updated title and intro accordingly.
  • .github/skills/interop-generator/SKILL.md: Integrated non-redundant info from the old spec's Overview and Build Infrastructure sections:
    • Added performance/security/usability benefits to the Overview
    • Added Accessing interop APIs paragraph documenting the [UnsafeAccessor]/[UnsafeAccessorType] pattern
    • Added Build infrastructure section with .NET SDK task/target links and a Version compatibility subsection
    • Added cross-references to the new name-mangling-scheme.md doc
    • Fixed "WinRT" → "Windows Runtime" in 11 places where it referred to the technology generically
  • .github/skills/update-interop-generator-instructions/SKILL.md: Added docs/cswinrtgen/name-mangling-scheme.md to the list of design documents to verify and update (step 13)

@Sergio0694 Sergio0694 added the documentation Improvements or additions to documentation label Mar 21, 2026
@Sergio0694 Sergio0694 requested a review from manodasanW March 21, 2026 18:53
@Sergio0694 Sergio0694 enabled auto-merge (squash) March 21, 2026 21:44
Sergio0694 and others added 2 commits March 21, 2026 16:34
Move the name mangling scheme specification from
docs/winrt-interop-dll-spec.md to
docs/cswinrtgen/name-mangling-scheme.md, to consolidate all
interop generator design documents under docs/cswinrtgen/.

The Overview and Build Infrastructure sections that were in the
old spec doc are being integrated into the interop generator
skill in a separate commit. The old doc is removed entirely.

The name mangling spec content is preserved as-is (verified
accurate against the InteropUtf8NameFactory implementation),
with a new title and introductory paragraph reflecting that
this document now focuses solely on the name mangling scheme.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Integrate the Overview and Build Infrastructure content from
the now-removed docs/winrt-interop-dll-spec.md into the
interop generator skill (.github/skills/interop-generator/SKILL.md):

- Add performance/security/usability benefits to Overview
- Add new 'Accessing interop APIs' paragraph documenting the
  [UnsafeAccessor]/[UnsafeAccessorType] pattern
- Add new 'Build infrastructure' section with .NET SDK task/target
  links, and a 'Version compatibility' subsection documenting the
  version matching logic and 'implementation details only' APIs
- Reference docs/cswinrtgen/name-mangling-scheme.md from the
  naming conventions section and the control flow cross-references

Update the update-interop-generator-instructions skill to include
docs/cswinrtgen/name-mangling-scheme.md in the list of design
documents to verify and update (step 13).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Sergio0694 Sergio0694 force-pushed the docs/consolidate-interop-generator-docs branch from 5268bf2 to 9f2b21f Compare March 21, 2026 23:34

`cswinrtinteropgen` must be versioned with the `WinRT.Runtime.dll` assembly it was compiled for. Not doing so will result in undefined behavior (e.g. failures to run the tool, or runtime crashes). To ensure these versions always match, the .NET SDK selects the right version of `cswinrtinteropgen` after all reference assemblies are resolved:

- If a project **does not** reference CsWinRT, then `cswinrtinteropgen` is loaded from the Windows SDK projections targeting pack.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit outdated with the current plan - sdk projection package only having the reference assembly and not the others.

@Sergio0694 Sergio0694 merged commit c8efd37 into staging/3.0 Mar 22, 2026
11 checks passed
@manodasanW manodasanW deleted the docs/consolidate-interop-generator-docs branch March 22, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants