Skip to content

System.Drawing.Common tests failed on Windows Mono due to COM wrappers #55655

Closed
@akoeplinger

Description

@akoeplinger

After #54884 these tests started failing on Mono on Windows:

  • ToBitmap_PngIconSupportedInSwitches_Success
  • ToBitmap_PngIconNotSupportedInSwitches_ThrowsArgumentOutOfRangeException
  • Ctor_IntPtrZeroIV_ThrowsArgumentException
  • Ctor_InvalidFrameUnitIII_ThrowsArgumentException
  • Ctor_InvalidEmfTypeIII_ThrowsArgumentException

Probably something to do with Mono not supporting COM on Windows: #39704 (comment)

Example stacktrace:

  System.TypeInitializationException: The type initializer for 'System.Drawing.DrawingCom' threw an exception.
 ---> System.PlatformNotSupportedException: Operation is not supported on this platform.
   at System.Drawing.DrawingCom.InitializeComInterfaceEntry() in /_/src/libraries/System.Drawing.Common/src/System/Drawing/DrawingCom.COMWrappers.cs:line 30
   at System.Drawing.DrawingCom..cctor() in /_/src/libraries/System.Drawing.Common/src/System/Drawing/DrawingCom.COMWrappers.cs:line 22
   --- End of inner exception stack trace ---
   at System.Drawing.Image.Save(Stream stream, ImageCodecInfo encoder, EncoderParameters encoderParams) in /_/src/libraries/System.Drawing.Common/src/System/Drawing/Image.Windows.cs:line 248
   at System.Drawing.Image.Save(Stream stream, ImageFormat format) in /_/src/libraries/System.Drawing.Common/src/System/Drawing/Image.Windows.cs:line 210
   at System.Drawing.Tests.IconTests.GetPngIcon() in /_/src/libraries/System.Drawing.Common/tests/IconTests.cs:line 685
   at System.Drawing.Tests.IconTests.<ToBitmap_PngIconSupportedInSwitches_Success>g__VerifyPng|44_0() in /_/src/libraries/System.Drawing.Common/tests/IconTests.cs:line 618
   at System.Drawing.Tests.IconTests.<>c.<ToBitmap_PngIconSupportedInSwitches_Success>b__44_1() in /_/src/libraries/System.Drawing.Common/tests/IconTests.cs:line 640
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) in /_/src/mono/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs:line 370

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions