dotnet / dotnet/winforms

Reflection API calls need type annotation

Open
#10,807 0 comments 1 reaction 0 assignees View on GitHub
area-ILLinker/AOT area-Trimming
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
1d 13m
Merged PRs (30d)
85

Description

Trimming [TrimTest ](https://github.com/dotnet/winforms/blob/main/src/System.Windows.Forms/tests/IntegrationTests/TrimTest/TrimTest.csproj)WinForms project require reflection calls to be [annotated ](https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/fixing-warnings)in WinForms code in below files:
- [Activator.CreateInstance(Type)](https://github.com/dotnet/winforms/blob/49c93b4b43c8f1a8d0ba8b041aeb0b9e89e815d0/src/System.Windows.Forms/src/System/Windows/Forms/DataBinding/ListBindingHelper.cs#L261)
- [Type.GetInterfaces()](https://github.com/dotnet/winforms/blob/49c93b4b43c8f1a8d0ba8b041aeb0b9e89e815d0/src/System.Windows.Forms/src/System/Windows/Forms/DataBinding/ListBindingHelper.cs#L520)
- [Type.GetProperties()](https://github.com/dotnet/winforms/blob/49c93b4b43c8f1a8d0ba8b041aeb0b9e89e815d0/src/System.Windows.Forms/src/System/Windows/Forms/DataBinding/ListBindingHelper.cs#L557)
- [Type.GetMethod()](https://github.com/dotnet/winforms/blob/49c93b4b43c8f1a8d0ba8b041aeb0b9e89e815d0/src/System.Windows.Forms/src/System/Windows/Forms/Internal/Formatter.cs#L438-L460)
- [Assembly.GetType(String, Boolean)](https://github.com/dotnet/winforms/blob/49c93b4b43c8f1a8d0ba8b041aeb0b9e89e815d0/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/Control.ActiveXImpl.cs#L1428)
- [Type.GetType()](https://github.com/dotnet/winforms/blob/49c93b4b43c8f1a8d0ba8b041aeb0b9e89e815d0/src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/Control.ActiveXImpl.cs#L1429)
- [Type.GetConstructor](https://github.com/dotnet/winforms/blob/49c93b4b43c8f1a8d0ba8b041aeb0b9e89e815d0/src/System.Windows.Forms/src/System/Windows/Forms/Panels/TableLayoutPanel/TableLayoutSettings.StyleConverter.cs#L32-L37)
- [TextBoxAutoCompleteSourceConverter ](https://github.com/dotnet/winforms/blob/8ffa229122e82ff1f09d6e038784b556c4488194/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TextBox/TextBoxAutoCompleteSourceConverter.cs#L11)is used in WinForms [code ](https://github.com/dotnet/winforms/blob/8ffa229122e82ff1f09d6e038784b556c4488194/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TextBox/TextBox.cs#L141)via reflection

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.