Skip to content
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

[release/9.0] Fix Profiles Attributes for Ref/Runtime Pack #4795

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

lonitra
Copy link
Member

@lonitra lonitra commented Nov 25, 2024

Backport of #4788

Customer Impact

Customers that have <FrameworkReference Include="Microsoft.WindowsDesktop.App.WindowsForms" /> in their winUI project or references packages that pulls same dlls as package Microsoft.WindowsDesktop.App.WindowsForms are no longer able to build successfully since this specifies WindowsForms profile, which now pulls in dlls that need to resolve System.Xaml when WinForms does not reference xaml. Specifically, adding the package reference now pulls in WindowsFormsIntegration.dll which should only be present when no profile is specified i.e. when users have both and in their project. This behavior has regressed since .NET 8

Additionally, when publishing a self-contained WinForms app, customers will have unnecessary dlls present that are not used by WinForms at all.

These issues are now occurring in .NET 9 because we had updated all dlls in both the runtime/ref pack to have a specified profile to support respecting profiles when publish self-contained winforms/wpf app. In the process of doing this, we had mis profiled a few dlls causing them to be pulled in when they shouldn't be for certain scenarios.

Testing

  • Compared FrameworkList.xml in msi produced by windowsdesktop build before and after change shows expected diff
  • Compared RuntimeList.xml in nupkg produced by AzDO build before and after change shows expected diff
  • Tested that this change fixes FrameworkReference Microsoft.WindowsDesktop.App.WindowsForms Incorrectly Includes WindowsFormsIntegration.dll #4789 by doing manual updates to FrameworkList.xml found in windowsdesktop ref pack and RuntimeList.xml found under path .nuget\packages\microsoft.windowsdesktop.app.runtime.<> to be the same as above FrameworkList.xml/RuntimeList.xml and observing rebuilding repro project succeeds
  • Tested Hello World (HW) WPF/WinForms app runs as expected with the manual changes to FrameworkList.xml/RuntimeList.xml
  • Tested HW WPF/WinForms app with trimming turned on runs as expected with the manual changes to FrameworkList.xml/RuntimeList.xml
  • Tested published self contained WPF/WinForms app and produced runs .exe as expected with the manual changes to FrameworkList.xml/RuntimeList.xml
  • Tested WPF apps hosting WinForms controls (UseWPF and UseWindowsForms both true) runs as expected with the manual changes to FrameworkList.xml/RuntimeList.xml
  • Tested publishing self contained WPF app hosting WinForms controls (UseWPF and UseWindowsForms both true) and produced .exe runs as expected with the manual changes to FrameworkList.xml/RuntimeList.xml

Risk

Low. The change corrects the mis profiled dlls in the ref/runtime pack and validation in various scenarios done to make sure there are no regressions.

@lonitra lonitra merged commit 5936e9c into release/9.0 Nov 26, 2024
8 checks passed
@lonitra lonitra deleted the backport4788 branch November 26, 2024 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants