0

In my UWP code, I used System.Drawing as below.

using System.Drawing;

And in my .csproj project file, if I set TargetPlatformMinVersion to be 10.0.17763.0, then things go right. But if I set TargetPlatformMinVersion to be 10.0.15063.0, then I get this compile error:

The type or namespace name 'Drawing' does not exist in the namespace 'System'

     <TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.17763.0</TargetPlatformVersion>
-    <TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
+    <TargetPlatformMinVersion>10.0.15063.0</TargetPlatformMinVersion>

I searched StackOverflow, post like this: System.drawing namespace not found under console application It suggests to find the System.Drawing by this way:

Project -> Right Click -> Add -> Reference -> Assemblies -> Search "System.Drawing"

But I failed to find it at all, please check the picture below. How to solve it?

enter image description here

Tom Xue
  • 3,169
  • 7
  • 40
  • 77
  • no you cant use system.Drawing in UWP [refer the answer for alternative](https://stackoverflow.com/a/31557036/11362349) –  Nov 27 '19 at 09:14

1 Answers1

0

If you want to use the Type under the System.Drawing namespace, you need to set the minimum version of UWP to 16299 and above.

If you have to set the minimum version of the app to 15063, you can consider using Win2D.uwp instead of System.Drawing, you can download it in here.

Best regards.

Richard Zhang
  • 7,523
  • 1
  • 7
  • 13