Skip to content

Conversation

@Sergio0694
Copy link
Member

Title.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds new internal/implementation-detail attributes to support authored Windows Runtime component scenarios in WinRT.Runtime2, primarily for consumption by generated code (CsWinRT) and authoring/activation metadata.

Changes:

  • Added WindowsRuntimeAuthoringAssemblyAttribute to mark authored WinRT component assemblies that produce their own .winmd.
  • Added WindowsRuntimeActivationFactoryAttribute to associate activation factory types with their authored runtime class types.
  • Added WindowsRuntimeExclusiveToInterfaceAttribute to mark interfaces as exclusive to a projected runtime class type.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/WinRT.Runtime2/InteropServices/Attributes/WindowsRuntimeAuthoringAssemblyAttribute.cs New assembly-level attribute for authored WinRT components producing their own metadata.
src/WinRT.Runtime2/InteropServices/Attributes/WindowsRuntimeActivationFactoryAttribute.cs New class-level attribute to link an activation factory to its runtime class type.
src/WinRT.Runtime2/Attributes/WindowsRuntimeExclusiveToInterfaceAttribute.cs New interface-level attribute to indicate interface exclusivity to a projected runtime class type.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Introduce WindowsRuntimeAuthoringAssemblyAttribute as a marker for assemblies that author Windows Runtime components (produce .winmd). The new sealed attribute (in WindowsRuntime.InteropServices) is marked [AttributeUsage(Assembly)], [EditorBrowsable(Never)] and [Obsolete] with CsWinRT diagnostic constants; it is intended to be emitted by the CsWinRT generator and not used directly. Includes an empty public constructor.
Introduce WindowsRuntimeExclusiveToInterfaceAttribute to annotate interfaces with their projected Windows Runtime class type. The sealed attribute targets interfaces, exposes a RuntimeClassType property set via constructor, and is marked Obsolete and EditorBrowsable(Never) to indicate it's for private implementation details and should not be used directly.
Rename the constructor parameter in WindowsRuntimeExclusiveToInterfaceAttribute from "interfaceType" to "runtimeClassType" and update the assignment to clarify that it represents the projected Windows Runtime class type. Add a new WindowsRuntimeActivationFactoryAttribute (src/WinRT.Runtime2/InteropServices/Attributes/WindowsRuntimeActivationFactoryAttribute.cs) to annotate the authored Windows Runtime class type for activation factories; the attribute is marked Obsolete (private implementation detail diagnostics) and EditorBrowsable(Never).
@Sergio0694 Sergio0694 force-pushed the user/sergiopedri/attributes branch from 0bb7620 to 69fedc1 Compare February 10, 2026 17:30
Rename WindowsRuntimeAuthoringAssemblyAttribute to WindowsRuntimeComponentAssemblyAttribute: file renamed and class, constructor, and XML doc updated to reflect the new name. No behavioral changes; this aligns the API/type name with component assembly semantics.
@Sergio0694 Sergio0694 enabled auto-merge (squash) February 10, 2026 18:35
@Sergio0694 Sergio0694 merged commit c76397f into staging/3.0 Feb 10, 2026
11 checks passed
@Sergio0694 Sergio0694 deleted the user/sergiopedri/attributes branch February 10, 2026 19:43
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.

2 participants