O'Leg
O'Leg

Reputation: 99

How to use System.Drawing on Mac OS?

  1. Run NuGet Package manager
  2. Add "System.Drawing.Common"
  3. Add using System.Drawing I still cannot use Point or Image in my code.

.csproj file does have

<PackageReference Include="System.Drawing.Common" Version="4.7.0"/>

Upvotes: 1

Views: 6441

Answers (2)

ya ali
ya ali

Reputation: 1

Install nuget runtime.osx.10.10-x64.CoreCompat.System.Drawing to allows you to use System.Drawing.Common on macOS

Upvotes: 0

SWHarden
SWHarden

Reputation: 146

I was able to get System.Drawing.Common working in OSX by also adding the runtime.osx.10.10-x64.CoreCompat.System.Drawing NuGet package.

Note that my OSX test platform is Azure Pipelines. You can look over my csproj file if you find it helpful. It contains:

<ItemGroup>
  <PackageReference Include="runtime.osx.10.10-x64.CoreCompat.System.Drawing" Version="5.8.64" />
  <PackageReference Include="System.Drawing.Common" Version="4.7.0" />
</ItemGroup>

Don't forget to add a using statement to the top of your CS files:

using System.Drawing;

Upvotes: 4

Related Questions