Skip to content

A blank .NET Core 3.1 WinForms app, published as self-contained and trimmed, still bundles all WPF DLLsΒ #3723

@noseratio

Description

@noseratio
  • .NET Core Version:
.NET Core SDK (reflecting any global.json):
 Version:   3.1.401
 Commit:    39d17847db

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19041
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\3.1.401\

Host (useful for support):
  Version: 3.1.7
  Commit:  fcfdef8d6b
  • Have you experienced this same bug with .NET Framework?:
    N/A

Problem description:
A blank 3.1 WinForms app, published as self-contained and trimmed, still bundles all WPF assemblies, which adds at least extra 12MB.

Expected behavior:
WPF assemblies (Presentation*.dll etc) should not be included if the are not used.

Minimal repro:

dotnet new winforms 
dotnet publish -r win-x64 -c Release --self-contained true /p:PublishTrimmed=true 
cd .\MyFormsAppCore\bin\Release\netcoreapp3.1\win-x64\publish 
dir Presentation*.dll

Note all Presentation*.dll

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions