-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
DesignerAttribute/EditorAttribute size implications #92043
Comments
Tagging subscribers to this area: @dotnet/area-system-componentmodel Issue DetailsWe annotated These two attributes have huge size impact on WinForms - I'm seeing 25+%. We should ideally do something about this.
Diff (click to expand)```diff diff --git a/src/libraries/System.ComponentModel.Primitives/src/ILLink/ILLink.LinkAttributes.xml b/src/libraries/System.ComponentModel.Primitives/src/ILLink/ILLink.LinkAttributes.xml new file mode 100644 index 00000000000..69c54060589 --- /dev/null +++ b/src/libraries/System.ComponentModel.Primitives/src/ILLink/ILLink.LinkAttributes.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/libraries/System.ComponentModel.Primitives/src/System.ComponentModel.Primitives.csproj b/src/libraries/System.ComponentModel.Primitives/src/System.ComponentModel.Primitives.csproj index fe840c389fd..16e8cc1ef0f 100644 --- a/src/libraries/System.ComponentModel.Primitives/src/System.ComponentModel.Primitives.csproj +++ b/src/libraries/System.ComponentModel.Primitives/src/System.ComponentModel.Primitives.csproj @@ -7,6 +7,9 @@ --> true + + + ```
|
If you use a PropertyGrid then having editor attributes is required in order to customize the UI of types in the grid. So I think they're often required. |
What is the total size savings, and is it just in Both of these I assume are not needed at runtime (only design-time). Do we have a mechanism during publish to distinguish between that and remove such artifacts? If not, could\should we add one? Some history: |
The savings is 6 MB for an empty WinForms app. (21 MB to 15 MB). This is not the size of ComponentModel.Primitives: that's tiny. To expand on the "We annotated DesignerAttribute/EditorAttribute such that they preserve things on the type that is referred from the attribute." in the top post: the problem is in the DynamicallyAccessedMembers annotations on these, e.g.: Line 20 in e1ca02f
These tell trimming to keep the referenced type, and that's where all the costs come from. |
Cc @eerhardt |
Fixed in #98378. |
We annotated
DesignerAttribute
/EditorAttribute
such that they preserve things on the type that is referred from the attribute.These two attributes have huge size impact on WinForms - I'm seeing 25+%.
We should ideally do something about this.
Diff (click to expand)
The text was updated successfully, but these errors were encountered: