C# 绘制通用Asp.Net内核的错误系统

C# 绘制通用Asp.Net内核的错误系统,c#,asp.net-core,system.drawing,C#,Asp.net Core,System.drawing,我使用Manage NuGet软件包安装System.Drawing.Common版本4.5.0-preview2-26406-04 在我的服务器上发布之后 当我运行project时,我得到了这个错误 Error: An assembly specified in the application dependencies manifest (General.deps.json) was not found: package: 'System.Drawing.Common'

我使用Manage NuGet软件包安装System.Drawing.Common版本4.5.0-preview2-26406-04 在我的服务器上发布之后 当我运行project时,我得到了这个错误

Error:
    An assembly specified in the application dependencies manifest (General.deps.json) was not found:
        package: 'System.Drawing.Common', version: '4.5.0-preview2-26406-04'
        path: 'runtimes/unix/lib/netcoreapp2.0/System.Drawing.Common.dll'

我能做什么?

正如@Mark G在上面的评论中提到的,
System.Drawing.Common
不会在Linux上运行,因此您需要安装Linux兼容的软件包。 在终端中使用此命令,
dotnet add package runtime.linux-x64.CoreCompat.System.Drawing--version 1.0.0-beta009
,安装linux兼容的
System.Drawing

之后,再次发布您的应用程序,现在一切都应该正常了。

作为一部分,它不会在其他平台上运行。看看备选方案。System.Drawing.Common在Linux和macOS上运行得非常好。您只需要确保安装它的本机依赖项libgdiplus。在Ubuntu/Debian上,您可以运行
apt-get-install-y libgdiplus
;在macOS上,您可以运行
brew安装mono-libgdiplus