Several structs in the System.Drawing.Primitives assembly are missing their TypeConverterAttribute decoration that was present in netfx. Below is a list of the structs that are missing the decoration including the converter they referenced.
|Struct|Converter|
|---|---|
|System.Drawing.Point |System.Drawing.PointConverter|
|System.Drawing.Rectangle |System.Drawing.RectangleConverter|
|System.Drawing.Size |System.Drawing.SizeConverter|
|System.Drawing.SizeF |System.Drawing.SizeFConverter|
|System.Drawing.Color |System.Drawing.ColorConverter|
This came up because PowerShell will use this attribute to determine additional conversion paths. With these attributes missing, any script that utilized these conversion paths (e.g. [System.Drawing.Point]'10,20') no longer work as expected.
Original issue: PowerShell/PowerShell#9815
@Anipik
I am on it
This is by design. TypeConverter is much higher in the stack in .NETCore so a lot of places that had TypeConverterAttribute in framework instead are handled intrinsically in TypeConverter itself. Powershell should not be examining metadata on types itself: just let the TypeConverter infrastructure do that. TypeDescriptor.GetConverter should tell you if a typeconverter is available, and typeconverters have CanConvert* methods that tell you if they can be used.
Most helpful comment
This is by design. TypeConverter is much higher in the stack in .NETCore so a lot of places that had TypeConverterAttribute in framework instead are handled intrinsically in TypeConverter itself. Powershell should not be examining metadata on types itself: just let the TypeConverter infrastructure do that. TypeDescriptor.GetConverter should tell you if a typeconverter is available, and typeconverters have CanConvert* methods that tell you if they can be used.