Skip to content

Hide WinRT.Host runtime assets in Solution Explorer - #2500

Merged
Sergio0694 merged 1 commit into
staging/3.0from
user/sergiopedri/hide-winrt-host-assets
Jul 30, 2026
Merged

Hide WinRT.Host runtime assets in Solution Explorer#2500
Sergio0694 merged 1 commit into
staging/3.0from
user/sergiopedri/hide-winrt-host-assets

Conversation

@Sergio0694

Copy link
Copy Markdown
Member

Summary

Mark the WinRT.Host.dll, WinRT.Host.dll.mui and WinRT.Host.Shim.dll items added by the authoring targets with Visible=false, so they no longer show up as project items in Solution Explorer. Fixes #2499.

Motivation

When a project authors a Windows Runtime component, Microsoft.Windows.CsWinRT.Authoring.targets adds three None items in an evaluation-time ItemGroup so the hosting assets get copied to the output directory. Because these items are created at evaluation time (as opposed to the Content items in the packaging target, which are only created while the target runs), Visual Studio surfaces them as regular project items in Solution Explorer.

These are purely build/runtime assets that come out of the CsWinRT NuGet package. Users are never meant to interact with them from Solution Explorer, and having them listed there is just noise (they also look out of place, since they're the only items in the project that live outside the project directory).

Changes

  • nuget/Microsoft.Windows.CsWinRT.Authoring.targets: add <Visible>false</Visible> metadata to the three hosting asset None items, and update the surrounding comment to explain why.

Note that Visible only affects how the items are displayed by the IDE, so the assets are still copied to the output directory exactly as before. This was verified by evaluating the targets file (all three items are still produced, with CopyToOutputDirectory=PreserveNewest intact) and by building a small project with equivalent items, which still copies both files to the output directory.

The WinRT.Host.dll, WinRT.Host.dll.mui and WinRT.Host.Shim.dll items are
build/runtime assets copied to the output directory, not files users are
meant to interact with. Mark them with Visible=false so they no longer
show up as project items in Solution Explorer, while still being copied
to the output directory as before.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 0b96f4f1-0434-43cd-b44a-dc4a132fb863
@Sergio0694 Sergio0694 added authoring Related to authoring feature work CsWinRT 3.0 labels Jul 29, 2026
@Sergio0694
Sergio0694 requested a review from manodasanW July 29, 2026 18:33
@azure-pipelines

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

@Sergio0694
Sergio0694 merged commit 0beca6c into staging/3.0 Jul 30, 2026
13 checks passed
@Sergio0694
Sergio0694 deleted the user/sergiopedri/hide-winrt-host-assets branch July 30, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

authoring Related to authoring feature work CsWinRT 3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants