microsoft / microsoft/WindowsAppSDK

Self-contained component targets expose runtime payloads as project items during DesignTimeBuild

Open
#6,666 2 comments 0 reactions 0 assignees View on GitHub
area-SelfContained needs-triage
Dominant language
C++
Stars
4.7k
Forks
471
Avg merge
3d 13h
Merged PRs (30d)
28

Description

### Describe the bug

When an executable SDK-style project references a Windows App SDK component package such as `Microsoft.WindowsAppSDK.WinUI`, the component package enables `WindowsAppSDKSelfContained` by default.

`Microsoft.WindowsAppSDK.SelfContained.targets` then adds all files under `runtimes-framework\win-\native` and `metadata` to the `None` item group with `Link` metadata.

These items are also created during `DesignTimeBuild`. IDEs that consume the resulting MSBuild project model, such as JetBrains Rider, display hundreds of runtime DLLs, MUI directories, assets, and WinMD files as linked project files.

For example:
- `af-ZA\Microsoft.ui.xaml.dll.mui`
- `metadata\Microsoft.Windows.AppLifecycle.winmd`
- `Microsoft.UI.Xaml.Controls.dll`

This makes Solution Explorer extremely large.

### Steps to reproduce the bug

Create an SDK-style project:

```xml


Exe
net8.0-windows10.0.26100.0
win-x64



```
Open the project in JetBrains Rider and expand it in Solution Explorer.

### Expected behavior

Runtime payload files required for self-contained deployment should be copied during normal build/publish, but should not be exposed as source project items during DesignTimeBuild.

### Screenshots

Image

### NuGet package version

1.8.250831001

### Packaging type

Unpackaged

### Windows version

Windows 11 version 24H2 (26100, June 2025 Update)

### IDE

Other

### Additional context

_No response_

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with Microsoft.WindowsAppSDK.SelfContained.targets and reproduce the issue using the SDK-style project and Microsoft.WindowsAppSDK.WinUI package described above. Inspect how the None items are added during DesignTimeBuild, then verify that runtime payload files remain available for normal build or publish without appearing as project items in the IDE model.

Written by the indexing model from the issue text.

Assessment

Domain
build-system, desktop, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.