Skip to content

Consider removing ConfigurationManager dependency from System.Drawing.Common #22761

Closed

Description

@mellinoe

The only usage of ConfigurationManager is in this internal class:

https://github.com/dotnet/corefx/blob/master/src/System.Drawing.Common/src/System/Drawing/BitmapSelector.cs#L33
In turn, BitmapSelector is only used by one public type:
https://github.com/dotnet/corefx/blob/master/src/System.Drawing.Common/src/System/Drawing/ToolboxBitmapAttribute.cs

There is already a "graceful" fallback path if there is no "system.drawing" ConfigurationSection defined, so we can easily just delete it. I find it extremely unlikely that anybody would ever care about this functionality going away: it looks incredibly obscure, and not that useful in the first place. The main use case seems to be for UI designers (like the VS WinForms designer), to select different bitmaps with. The .NET Core version of the library likely won't ever be used for that.

Thoughts @hughbe @stephentoub ?

Activity

  1. hughbe commented on Jul 14, 2017

    @hughbe
    Contributor

    From the comments:

    /// Gets the bitmap ID suffix defined in the application configuration, or string.Empty if
    /// the suffix is not specified. Internal for unit tests
     

    Could it be that this was never meant to have been exposed?

  2. mellinoe commented on Aug 8, 2017

    @mellinoe
    ContributorAuthor

    This dependency was removed as part of targeting .NET Core 2.0.

  3. transferred this issue fromdotnet/corefxon Jan 31, 2020
  4. added this to the 2.1.0 milestone on Jan 31, 2020
  5. ghost locked as resolved and limited conversation to collaborators on Dec 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions