dotnet / dotnet/winforms

ToolboxBitmapAttribute no longer supports resource/assembly name Suffixes

Open
#8,832 1 comment 1 reaction 0 assignees View on GitHub
area-System.Drawing
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
20h 23m
Merged PRs (30d)
103

Description

With https://github.com/dotnet/runtime/issues/22761 and https://github.com/dotnet/corefx/pull/22833, BitmapSelector.Suffix will always be null, with no external way of setting it to anything else.

https://github.com/dotnet/runtime/blob/1306b036c1414afa39608ed8ede24fe003191132/src/libraries/System.Drawing.Common/src/System/Drawing/BitmapSelector.cs#L15-L38

The implementation of the suffix feature tries looking for the following attributes on an assembly:

1. BitmapSuffixInSameAssemblyAttribute
2. BitmapSuffixInSatelliteAssemblyAttribute

However, since the Suffix will only ever be `null`, these attributes have no effect. Even if they are applied to an assembly, since the Suffix will always be `null`, nothing gets appended to the names:

https://github.com/dotnet/runtime/blob/1306b036c1414afa39608ed8ede24fe003191132/src/libraries/System.Drawing.Common/src/System/Drawing/BitmapSelector.cs#L144-L185

Thus, the `originalName` is only ever used, and the attributes didn't do anything.

We should either add back support for `Suffix` here, or we should `[Obsolete]` these attributes, since they don't do anything.

NOTE: I am removing all this dead code in https://github.com/dotnet/runtime/pull/54364/. We can add it back if necessary in the future.

cc @safern @JeremyKuhne

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.