0
votes
  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"/>
1
What kind of project? Please share the whole project file. - Lex Li
@LexLi - <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp3.1</TargetFramework> </PropertyGroup> <ItemGroup> <PackageReference Include="System.Drawing.Common" Version="4.7.0"/> </ItemGroup> </Project> - O'Leg
@LexLi how do I know upfront what info is necessary? Did this info lead you to the answer? - O'Leg
@BACON Didn't address the issue. - O'Leg

1 Answers

2
votes

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;