Hi,
Will Aspose.Cells support .NET 6 on Linux? System.Drawing.Common
is no longer supported on non-Windows systems (because libgdiplus
is of poor quality). See this official MS documentation page about this breaking change.
I know Aspose.Cells has a dependency on System.Drawing.Common
in some cases as I’m getting the following error with the latest version (v21.12.0) in production.
System.TypeInitializationException: The type initializer for '\u0006 ' threw an exception.
---> System.TypeInitializationException: The type initializer for 'Gdip' threw an exception.
---> System.PlatformNotSupportedException: System.Drawing.Common is not supported on non-Windows platforms. See https://aka.ms/systemdrawingnonwindows for more information.
at System.Drawing.LibraryResolver.EnsureRegistered()
at System.Drawing.SafeNativeMethods.Gdip..cctor()
--- End of inner exception stack trace ---
at System.Drawing.SafeNativeMethods.Gdip.GdipStringFormatGetGenericTypographic(IntPtr& format)
at System.Drawing.StringFormat.get_GenericTypographic()
at \u0006 ..cctor()
--- End of inner exception stack trace ---
at \u0008 .\u0002(String \u0002, Font \u0003, Double \u0005)
at \u000F .\u0002(Int32 \u0002, Int32 \u0003, Int32 \u0005, Int32 \u0008, AutoFitterOptions \u0006)
at \u000F .\u0002(Cells \u0002, Int32 \u0003, Int32 \u0005, Int32 \u0008, Int32 \u0006, AutoFitterOptions \u000E)
at Aspose.Cells.Worksheet.AutoFitColumns()
I don’t exactly know when that dependency comes into play. But even so, I tried activating the temporary legacy support in the runtimeconfig.json
file as explained in the doc and the error I now get is:
System.TypeLoadException: Cannot load type '\u0006 , Aspose.Cells, Version=21.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56'.
at Aspose.Cells.Workbook.Save(Stream stream, SaveOptions saveOptions)
at Aspose.Cells.Workbook.Save(Stream stream, SaveFormat saveFormat)
Here’s a reproduction of the later problem:
CellsDotnet6.zip (2.2 KB)
It uses a Docker Alpine Linux image base to run a simple Aspose.Cells program.
Thanks.