-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Self-contained deployment of WinForms always includes WPF assemblies #4078
Comments
I'm running into the same issue, is there any plan to fix this in the .NET 5.0 time frame? |
You can use explicit FrameworkReference to WindowsForms. <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<!-- Use explicit -->
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
</PropertyGroup>
<ItemGroup>
<!-- .NET Runtime -->
<FrameworkReference Include="Microsoft.NETCore.App" />
<!-- Windows Forms -->
<FrameworkReference Include="Microsoft.WindowsDesktop.WindowsForms” />
</ItemGroup>
</Project> I use this technique in my project to prevent adding Windows Forms assemblies to Console application https://habr.com/ru/post/549530/ |
For .NET 6 and 5 When I specify |
Moved from dotnet/winforms#2426. Related: dotnet/linker#832
Problem description:
dotnet new
or VS)Actual behavior:
Published output contains large part of WPF stack (eg. PresentationCore.dll, PresentationUI.dll, PresentationFramework*.dll, etc.) which amounts to over 30 Mb (> 10 Mb compressed) of unused assemblies. The files are pulled from the "runtimepack.Microsoft.WindowsDesktop.App.Runtime.win-x86/3.0.0" NuGet package.
Expected behavior:
No WPF assemblies in the output. They should either not be included or they should get trimmed out.
Minimal repro:
WindowsFormsApp1.zip
The text was updated successfully, but these errors were encountered: