Skip to content

System.Drawing.ImageConverter raise the System.PlatformNotSupportedException on Linux #1011

@alepikhov

Description

@alepikhov

dotnet --version
3.1.100
nuget packeges:

  • System.Drawing.Common 4.7.0
  • System.Configuration.ConfigurationManager 4.7.0
    OS: Linux

Steps to reproduce:
Environment: Linux with dotnet 3.1.100

  1. dotnet new console
  2. dotnet add package System.Drawing.Common
    Installed version: 4.7.0
  3. modify Program.cs file
    add new lines:
    var converter = System.ComponentModel.TypeDescriptor.GetConverter(typeof(System.Drawing.Image)); Console.WriteLine($"{converter?.GetType()}");
  4. dotnet run
    Console output:

"System.ComponentModel.TypeConverter"

  1. dotnet add package System.Configuration.ConfigurationManager
    Installed version: 4.7.0
  2. dotnet run
    Console output:

Unhandled exception. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.PlatformNotSupportedException: System.Windows.Extensions types are not supported on this platform.
at System.Drawing.ImageConverter..ctor()
--- End of inner exception stack trace ---
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean wrapExceptions, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& hasNoDefaultCtor)
at System.RuntimeType.CreateInstanceDefaultCtorSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean fillCache)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, Boolean wrapExceptions)
at System.Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions)
at System.Activator.CreateInstance(Type type)
at System.ComponentModel.ReflectTypeDescriptionProvider.CreateInstance(Type objectType, Type callingType)
at System.ComponentModel.ReflectTypeDescriptionProvider.ReflectedTypeData.GetConverter(Object instance)
at System.ComponentModel.TypeDescriptor.TypeDescriptionNode.DefaultTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetConverter()
at System.ComponentModel.TypeDescriptor.GetConverter(Type type)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions