Skip to content

PlatformNotSupportedException thrown by System.Drawing.Common on net7.0-windows10.0.22621.0 #81639

@raphm4044

Description

@raphm4044

Description

When the runtime is set to net7.0-windows10.0.22621 (.NET 7 but with Windows 10.0.22621.0 as target OS), System.Drawing.Common is throwing a PlatformNotSupportedException exception.

It's should be supported, the target OS is Windows 11 22H2.

Reproduction Steps

1 : Create a console app on .NET 7
2 : Set the target OS to Windows & the target OS version to 10.0.22621
Now it should look like this :
image
3 : Install the System.Drawing.Common NuGet package
4 : Create a Graphics class (var g = new Graphics();)
5 : Run the console app and see the exception come.

Expected behavior

It should work because the target OS is Windows.

Actual behavior

It throws an PlatformNotSupportedException exception.

Regression?

No response

Known Workarounds

No response

Configuration

The code is running on .NET 7 (with Windows 11 22H2 set as target OS)

My OS is Windows 11 22H2 x64 (build 10.0.22621.1105, vanilla)

My PC is a ThinkPad T460

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Drawingneeds-author-actionAn issue or pull request that requires more info or actions from the author.no-recent-activityquestionAnswer questions and provide assistance, not an issue with source code or documentation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions