-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Description
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
- dotnet new console
- dotnet add package System.Drawing.Common
Installed version: 4.7.0 - modify Program.cs file
add new lines:
var converter = System.ComponentModel.TypeDescriptor.GetConverter(typeof(System.Drawing.Image)); Console.WriteLine($"{converter?.GetType()}"); - dotnet run
Console output:
"System.ComponentModel.TypeConverter"
- dotnet add package System.Configuration.ConfigurationManager
Installed version: 4.7.0 - 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)