【问题标题】:System.Drawing is not found in Assemblies at allSystem.Drawing 在程序集中根本找不到
【发布时间】:2020-03-22 18:25:28
【问题描述】:

在我的 UWP 代码中,我使用了 System.Drawing,如下所示。

using System.Drawing;

在我的 .csproj 项目文件中,如果我将 TargetPlatformMinVersion 设置为 10.0.17763.0,那么一切正常。但如果我将 TargetPlatformMinVersion 设置为 10.0.15063.0,则会出现以下编译错误:

命名空间中不存在类型或命名空间名称“Drawing” '系统'

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

我搜索了 StackOverflow,发帖如下: System.drawing namespace not found under console application 它建议通过这种方式找到 System.Drawing:

项目 -> 右键单击​​ -> 添加 -> 参考 -> 程序集 -> 搜索 "系统.绘图"

但是我根本没找到,请看下图。如何解决?

【问题讨论】:

标签: uwp


【解决方案1】:

如果要使用System.Drawing命名空间下的Type,需要将UWP的最低版本设置为16299及以上。

如果你必须将应用的最低版本设置为15063,可以考虑使用Win2D.uwp而不是System.Drawing,可以在here下载。

最好的问候。

【讨论】:

    猜你喜欢
    • 2012-01-23
    • 2014-02-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-19
    • 2012-12-13
    • 2010-10-27
    相关资源
    最近更新 更多