[英]Errors while trying to use System.Drawing in .Net Core Console Application
我正在嘗試在Ubuntu 18.04上運行的.Net Core Console應用程序中使用System.Drawing.Common創建一個Bitmap,但是只要我執行代碼它就會顯示:
The type initializer for 'Gdip' threw an exception. at System.Drawing.SafeNativeMethods.Gdip.GdipCreateBitmapFromScan0(Int32 width, Int32 height, Int32 stride, Int32 format, HandleRef scan0, IntPtr& bitmap) at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format) at MidnightBot.Modules.AdminCommands.CreatePollAsync(String Term1, String Term2, String Description) in /home/MidnightBot/Modules/AdminCommands.cs:line 125 System.DllNotFoundException: Unable to load DLL 'libgdiplus': The specified module could not be found. at System.Runtime.InteropServices.FunctionWrapper`1.get_Delegate() at System.Drawing.SafeNativeMethods.Gdip.GdiplusStartup(IntPtr& token, StartupInput& input, StartupOutput& output) at System.Drawing.SafeNativeMethods.Gdip..cctor()
我也試着做這里描述的內容。 但沒有成功。
謝謝你的幫助。
您需要使用包管理器安裝gdiplus庫。 例如:
sudo apt-get install libgdiplus
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.