Skip to content

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

Description

@Illustar0

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-<arch>\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:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0-windows10.0.26100.0</TargetFramework>
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference
        Include="Microsoft.WindowsAppSDK.WinUI"
        Version="1.8.250906003" />
  </ItemGroup>
</Project>

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions