Skip to content

[NET10][Regression] error CS0012: The type 'IImage' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Private.Windows.GdiPlus, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. #11246

@jlaanstra

Description

@jlaanstra

Description

In .NET 10 ref/net10.0/System.Private.Windows.GdiPlus.dll was added to the WindowsDesktop pack and is referenced from System.Drawing.Common.dll.

However, System.Drawing.Common.dll is included in both WindowsForms and WPF profiles while System.Private.Windows.GdiPlus.dll is only included for WIndowsForms, causing compile error in WPF projects when specific types from System.Drawing.Common.dll are used.

Reproduction Steps

Add the following code to a WPF project and compile:

var bitmap = new Bitmap();

Expected behavior

No compile errors.

Actual behavior

error CS0012: The type 'IImage' is defined in an assembly that is not referenced.

Regression?

Yes, From .NET 9

Known Workarounds

No response

Impact

No response

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions