question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

System.Drawing.Common is deprecated on non-Windows platforms

See original GitHub issue

Hello, I work on the .NET Libraries team, and I saw that this library has a lot of usage in the community and depends on System.Drawing.Common for xplat scenarios.

We made the decision to make System.Drawing.Common a windows only library starting .NET6+ due to a lot of reasons after a long discussion. You can see more details here: https://github.com/dotnet/designs/blob/a15a8c7a324c482c5e38b73e46c2afe56f6bd504/accepted/2021/system-drawing-win-only/system-drawing-win-only.md

Also: https://github.com/dotnet/docs/issues/25257

We wanted to reach out so that you could react to this changes when .NET 6 is released. Also if you have any questions/concerns please do let us know at https://github.com/dotnet/runtime

What is the recommended action to still support winforms/wpf scenarios for example?

You can mark the APIs that need to use System.Drawing.Common to support winforms/wpf as windows only using the SupportedOSPlatform("windows") annotation, and then add new APIs that use another library like ImageSharp or `SkiaSharp. System.Drawing.Common is deprecated on non-Windows platforms

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:38 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
Xenoagecommented, Jun 29, 2022

Our fork, using ImageSharp instead of System.Drawing, is working fine so far and is already deployed in production. Sorry for not having the time to clean up a few things and creating a pull request yet. I’ll do that as soon as possible.

2reactions
emisandcommented, Mar 2, 2022

@tonyqus I have been migrating our company solution from System.Drawing to ImageSharp. I think it’s one of the most straightforward options to choose, it’s fully made with .NET code, and it does not have any external dependencies to binaries in the system like SkiaShap or Maui have,

You will start by adding these two package references:

<PackageReference Include="SixLabors.ImageSharp" Version="2.0.0" />
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="1.0.0-beta14" />

Documentation on the image handling: https://docs.sixlabors.com/articles/imagesharp/gettingstarted.html Documentation on the graphics drawing: https://docs.sixlabors.com/articles/imagesharp.drawing/gettingstarted.html

Let me know if you encounter any issues while migrating.

Read more comments on GitHub >

github_iconTop Results From Across the Web

System.Drawing.Common only supported on Windows - .NET
Learn about the .NET 6 breaking change where the System.Drawing.Common package is no longer supported on non-Windows operating systems.
Read more >
System.Drawing.Common is deprecated on non-Windows ...
Hello, I work on the .NET Libraries team, and I saw that this library has a lot of usage in the community and...
Read more >
`System.Drawing.Common` will only be supported on ...
Drawing.Common work on non-Windows platforms and instead propose we only keep evolving it in the context of Windows Forms and GDI+. Design ...
Read more >
Is it safe to use System.Drawing.Common 4.7.3?
Drawing.Common and I noticed that while version 6 and 7 are not usable on Linux, version 5 is marked as deprecated and versions...
Read more >
System.Drawing.Common replacement for .NET 7
This is problematic for .NET library developers who maintain cross-platform libraries that use System.Drawing.Common because Microsoft's recommended action ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found