Skip to content

Preserve exact type selection in merged projections - #2553

Merged
Sergio Pedri (Sergio0694) merged 1 commit into
staging/3.0from
user/sergiopedri/exact-projection-filtering
Sep 10, 2026
Merged

Preserve exact type selection in merged projections#2553
Sergio Pedri (Sergio0694) merged 1 commit into
staging/3.0from
user/sergiopedri/exact-projection-filtering

Conversation

@Sergio0694

Copy link
Copy Markdown
Member

Summary

Preserve the exact type surface of reference projections when generating merged implementation projections. Keep existing namespace-prefix filtering for the Windows SDK, WinUI additions, and reference-projection settings.

Motivation

The merged projection generator currently passes fully qualified type names from reference assemblies to a prefix filter. An include for Contoso.User can therefore match both Contoso.User2 and the namespace Contoso.UserProfile, regenerating types deliberately omitted from the reference projection and introducing unsupported API signatures.

The reference assembly already describes the intended type set. Separating exact identities from intentional prefix rules preserves that surface without requiring new consumer-facing MSBuild properties or adding support for previously excluded APIs.

Changes

  • src\WinRT.Projection.Generator\Generation\ProjectionGenerator.Generate.cs: populate exact type includes from projection reference assemblies and component metadata, while retaining intentional SDK and WinUI namespace rules.
  • src\WinRT.Projection.Writer\: add the IncludeTypes option, preserve exclude precedence and existing prefix semantics, and prevent exact type includes from enabling namespace additions.
  • src\Tests\ProjectionWriterTest\: add synthetic metadata and regression coverage for type-name and namespace collisions, mixed filters, exclude precedence, namespace additions, and required exclusive-to factory infrastructure.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Separate exact type identities from namespace prefix filters so app-time generation preserves reference projection exclusions without changing existing SDK or WinUI filtering.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@Sergio0694
Sergio Pedri (Sergio0694) force-pushed the user/sergiopedri/exact-projection-filtering branch from b79d0ea to b6b12bb Compare September 9, 2026 23:42
[DataRow("Contoso.UserProfile.UserSetupManager", false)]
[DataRow("Contoso.User.Profile", false)]
[DataRow("Contoso.Users.User", false)]
[DataRow("contoso.User", false)]

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.

so we are saying here this one is case sensitive right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah it should be, namespaces are case sensitive in .NET

@Sergio0694
Sergio Pedri (Sergio0694) merged commit ece39f2 into staging/3.0 Sep 10, 2026
13 checks passed
@Sergio0694
Sergio Pedri (Sergio0694) deleted the user/sergiopedri/exact-projection-filtering branch September 10, 2026 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working CsWinRT 3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants