You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Building a WinForms application causes Wpf assemblies to be pulled in since the Microsoft.WindowsDesktop.App.Runtime pack does not distinguish between WinForms-Wpf assemblies. However, the targeting pack Microsoft.WindowsDesktop.App.Ref, does distinguish between WinForms-Wpf assemblies.
A good description of the problem can be found here.
A possible solution is proposed by @AustinWise in the same issue here with detailed information on how the targeting pack respects WinForms profile, and with a suggestion on how the same approach could be applied to the runtime pack.
To Reproduce
dotnet new WinForms
dotnet publish --self-contained true
You should be able to see Wpf assemblies like PresentationFramework.dll in the published directory. Another option is to use static analysis tools like ILLinker or ILCompiler to show warnings stemming from Wpf assemblies. One such approach is outlined here.
Further technical details
Building trimmed and native AOT WinForms applications can be made easier without the Wpf assemblies. The size win is an additional advantage.
The text was updated successfully, but these errors were encountered:
Describe the bug
Building a WinForms application causes Wpf assemblies to be pulled in since the Microsoft.WindowsDesktop.App.Runtime pack does not distinguish between WinForms-Wpf assemblies. However, the targeting pack Microsoft.WindowsDesktop.App.Ref, does distinguish between WinForms-Wpf assemblies.
A good description of the problem can be found here.
A possible solution is proposed by @AustinWise in the same issue here with detailed information on how the targeting pack respects WinForms profile, and with a suggestion on how the same approach could be applied to the runtime pack.
To Reproduce
You should be able to see
Wpf
assemblies like PresentationFramework.dll in the published directory. Another option is to use static analysis tools likeILLinker
orILCompiler
to show warnings stemming fromWpf
assemblies. One such approach is outlined here.Further technical details
Building trimmed and native AOT WinForms applications can be made easier without the Wpf assemblies. The size win is an additional advantage.
The text was updated successfully, but these errors were encountered: