dotnet / dotnet/wpf

WPF publish adds Windows Forms dlls (including design time dlls)

Open
#6,761 4 comments 1 reaction 0 assignees View on GitHub
area-NetSDK needs team triage Untriaged
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

### Describe the bug
As the title is, a plain WPF application seems to somehow publish the Windows Forms dlls, including the design time ones, which are both very large and (presumably) not necessary.

### To Reproduce

1. Clone https://github.com/myblindy/wpf-publish-issue and open the solution
2. Create a basic self-contained publish to folder profile, mine was Windows-x64. Like this:
![image](https://user-images.githubusercontent.com/541998/172206211-1ef87829-22ae-4c32-8b62-42b87356576d.png)
3. Publish to the folder
4. Notice the WF dlls in the publish folder:
![image](https://user-images.githubusercontent.com/541998/172206408-f8736a03-c4b9-4a88-950b-9c5e538819ab.png)

### Exceptions (if any)

N/A

### Further technical details
- Include the output of `dotnet --info`

```
PS C:\Program Files\Microsoft Visual Studio\2022\Preview> dotnet --info
.NET SDK (reflecting any global.json):
Version: 7.0.100-preview.1.22110.4
Commit: 129d2465c8

Runtime Environment:
OS Name: Windows
OS Version: 10.0.19042
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\7.0.100-preview.1.22110.4\

Host (useful for support):
Version: 7.0.0-preview.1.22076.8
Commit: 405337939c

.NET SDKs installed:
2.1.500 [C:\Program Files\dotnet\sdk]
5.0.404 [C:\Program Files\dotnet\sdk]
6.0.300-preview.22204.3 [C:\Program Files\dotnet\sdk]
7.0.100-preview.1.22110.4 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.0-preview.1.22109.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.0-preview.1.22076.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.23 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.0-preview.1.22077.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
```

- The IDE (VS / VS Code/ VS4Mac) you're running on, and its version

Visual Studio 2022 Version 17.2.0 Preview 4.0, but this has been an issue for a long while, on both .Net 6 and 7 (haven't tried before that).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.