.NET Core and System.Drawing

前端 未结 5 1635
孤城傲影
孤城傲影 2020-12-01 07:53

I am trying to reference System.Drawing in a .net core console app targeting net46 but the assembly is not there. According to MS if you use dotnetcore System.Drawing is not

5条回答
  •  星月不相逢
    2020-12-01 08:48

    System.Drawing is not a good option with ASP.NET (more here: http://www.asprangers.com/post/2012/03/23/Why-you-should-not-use-SystemDrawing-from-ASPNET-applications.aspx)

    If you want graphics manipulation i suggest to use ImageSharp (https://github.com/JimBobSquarePants/ImageSharp) on .Net Core or ImageProcessor (http://imageprocessor.org/) / ImageResizer (https://imageresizing.net/) on .Net Framework

    Also, if you really need to use System.Drawing change frameworks in your project.json to netstandard1.6 and add in dependencies "NETStandard.Library": "1.6.1"

提交回复
热议问题