pan*_*nis 16 .net c# .net-core asp.net-core
我试图在针对net46的.net核心控制台应用程序中引用System.Drawing,但程序集不在那里.根据MS,如果你使用dotnetcore System.Drawing不可用.但是,如果您引用完整的.net框架,您应该能够使用它
这是我的project.json
{
"version": "1.0.0-*",
"buildOptions": {
"emitEntryPoint": true
},
"dependencies": {
},
"frameworks": {
"net46": {
}
}
}
Run Code Online (Sandbox Code Playgroud)
不知道是什么问题
J. *_*Doe 11
System.Drawing对于ASP.NET来说不是一个好的选择(更多这里:http://www.asprangers.com/post/2012/03/23/Why-you-should-not-use-SystemDrawing-from-ASPNET-applications.aspx)
如果你想要图形操作我建议在.Net Core或ImageProcessor(http://imageprocessor.org/)/ ImageResizer(https://imageresizing.net/)上使用ImageSharp(https://github.com/JimBobSquarePants/ImageSharp)).Net Framework
此外,如果您确实需要System.Drawing在project.json中使用更改框架netstandard1.6并添加依赖项"NETStandard.Library": "1.6.1"
我知道这很旧,但是现在有一个名为的库端口System.Drawing.Common。尝试使用NuGet安装那个。
为了使之成为可能,有一个名为的元包Windows Compatibility Pack。但是,此元软件包包括许多与Windows相关的API(作为软件包分发)。
资料来源:https : //developers.de/2018/01/22/how-to-use-system-drawing-in-net-core/
| 归档时间: |
|
| 查看次数: |
22278 次 |
| 最近记录: |