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

Add a new feature switch for WinForms trimming #10813

Open
Tracked by #4649
LakshanF opened this issue Feb 2, 2024 · 0 comments
Open
Tracked by #4649

Add a new feature switch for WinForms trimming #10813

LakshanF opened this issue Feb 2, 2024 · 0 comments

Comments

@LakshanF
Copy link
Member

LakshanF commented Feb 2, 2024

Trimming WinForms will require a feature switch to be used similar to other feature switches when trimming WinForms applications.

Exploring the trim warnings from the TrimTest project shows the following where having a feature switch could help:

  • Separate design time (where trimming is not required) and runtime experiences. Design time experience should be able to leverage trim incompatible capabilities like reflection and the publishing experience for trimmed applications should not generate trim warnings for the code that is only leveraged only at design time.
  • The vast majority of the trim warnings are actually not hit by simple WinForms applications like the TrimTest project. Code hitting trim warnings that is not currently tracked by Epic - Make WinForms trim compatible #4649 could be refactored such that setting the feature switch would remove these code paths. The current set of feature switch values are as below
  • Its very likely the type extension mechanism offered by WinForms need to be curtailed with a feature switch for trimming. For example, ICustomTypeDescriptor likely need to be restricted and code paths that use this interface will need to be removed via the feature switch.
    Default_Trimmed_Warnings_wpf_attributes_excluded_ComponentModel_ICustomTypeDescriptor.txt
  • Not to use WPF assemblies (assume UseWPF property is set to false).
  • Will be opted in for a strongly typed binding model.
  • Remove the current WinForms trimming prevention block when this feature switch is set.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants