- Code: Select all
var workbook = new Workbook();
in a.Net Core 5 apllication running in a Linux docker container I get an "System.PlatformNotSupportedException" for System.Drawing.Common.
Does Spire.XLS need a special lib installed as does Spire.Doc on Linux?
Exception 01 ===================================
Type: System.TypeInitializationException
Source: sprឳ, Spire.XLS, Version=9.2.16.19320, Culture=neutral, PublicKeyToken=663f351905198cb3
Message: The type initializer for 'sprឳ' threw an exception.
Trace: at sprឳ..ctor()
at sprᝫ..ctor()
at sprង..ctor()
at Spire.Xls.Workbook..ctor()
at ... /Actions/Eventbus/Document/CreateDocumentCommandV2.cs:line 267
at ... /Actions/Eventbus/Document/CreateDocumentCommandV2.cs:line 688
Location:
Method: Void .ctor() (0, 0)
Exception 02 inner --------------------------
Type: System.TypeInitializationException
Source: System.Drawing.SafeNativeMethods+Gdip, System.Drawing.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
Message: The type initializer for 'Gdip' threw an exception.
Trace: at System.Drawing.SafeNativeMethods.Gdip.GdipCreateBitmapFromScan0(Int32 width, Int32 height, Int32 stride, Int32 format, IntPtr scan0, IntPtr& bitmap)
at Spire.Xls.Core.Spreadsheet.UtilityMethods.ᜀ(Int32 A_0, Int32 A_1, PixelFormat A_2)
at Spire.Xls.Core.Spreadsheet.UtilityMethods.ᜀ(Int32 A_0, Int32 A_1)
at sprឳ..cctor()
Location:
Method: Int32 GdipCreateBitmapFromScan0(Int32, Int32, Int32, Int32, IntPtr, IntPtr ByRef) (0, 0)
Exception 03 inner --------------------------
Type: System.PlatformNotSupportedException
Source: System.Drawing.LibraryResolver, System.Drawing.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
Message: System.Drawing.Common is not supported on non-Windows platforms. See ...
Trace: at System.Drawing.LibraryResolver.EnsureRegistered()
at System.Drawing.SafeNativeMethods.Gdip.PlatformInitialize()
at System.Drawing.SafeNativeMethods.Gdip..cctor()
Location:
Method: Void EnsureRegistered() (0, 0)