这个不祥的“System.Drawing”警告意味着什么?

时间:2016-01-13 22:04:55

标签: asp.net imaging

我正在为ASP.NET网站开发一些图像处理代码,最终将作为Web服务公开。

在System.Drawing命名空间docs的底部:

https://msdn.microsoft.com/en-us/library/system.drawing.aspx

这是一个不祥的警告:

Classes within the System.Drawing namespace are not supported for use 
within a Windows or ASP.NET service. Attempting to use these classes from 
within one of these application types may produce unexpected problems, such 
as diminished service performance and run-time exceptions. For a supported 
alternative, see Windows Imaging Components.

“ASP.NET服务”是指网络服务吗?我认为“Windows Imaging Components”不是为了做我正在处理的图像而设计的。

System.Drawing命名空间对于ASP.NET Web服务中的图像处理是否安全?

1 个答案:

答案 0 :(得分:1)

该语句表示任何ASP.NET应用程序,包括WebForms,MVC,Web API和SignalR。

System.Drawing仅适用于在普通用户会话中运行的WinForms或控制台应用程序。

其他人可能会声称System.Drawing在那些不受支持的场景中适用于他们,但根本不支持Microsoft。