Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Tue Sep 20, 2022 9:56 pm

My setup is an ASP.NET CORE 6.0 web application.We are using FreeSpire.XLS 12.2.0 - evaluating before purchasing. The Docker is Ubuntu 20.04 based.

The exception happens when creating a new workbook, e.g. Workbook wbToStream = new();. At first I got the Platform Not Supported exception, but then I applied the runtimeconfig.json settings referred to in the Microsoft docs on System.Drawing.Common only supported on Windows and the Creating workbook on Linux throws exception post on this board. The new exception is as follows:
DllNotFoundException: Unable to load shared library 'libgdiplus' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibgdiplus: cannot open shared object file: No such file or directory


Added the Nuget SkiaSharp.NativeAssets. Linux did not help. FYI I had to change the web links to be inert because it said I could not post URLs

mdudgeon
 
Posts: 2
Joined: Tue Sep 20, 2022 9:19 pm

Wed Sep 21, 2022 2:36 am

Hello,

Thanks for your inquiry.
Yes, Microsoft made a statement that there will be errors when using System.Drawing library on non-Windows operating systems from .NET6.0 onwards. Kindly note that our NetStandard dlls are not dependent on System.Drawing.Common, they are dependent on SkiaSharp library.
You can download our MSI Free Spire.XLS for .NET Version:12.7, after you install it, you will find the netstandard2.0 folder from the installation directory, you need to manually reference the dlls from this folder and add the following dependency libraries to use it.
SkiaSharp >= 1.68.0
System.Text.Encoding.CodePages >= 4.5.0
System.Memory >= 4.5.0
System.Buffers >= 4.5.0
System.Runtime.CompilerServices.Unsafe >= 4.5.0
Meanwhile, kindly note that our Free version is limited to 5 sheets per workbook and 200 rows per sheet. It doesn't support the print function. When converting Excel files to other formats, such as you can only get the first 3 pages of PDF/XPS, and you can only convert first 3 sheets to Images. Thus, we suggest that you can directly install our commercial version (Spire.Officefor.NETStandard 7.8.4) via Nuget to test. We are willing to provide a temporary license (one month free) of Spire.XLS for .NET to help you remove the warning message and evaluate our commercial version better. If you need it, please feel free to write back.

Sincerely,
Simple
E-iceblue support team
User avatar

Simple.Li
 
Posts: 248
Joined: Fri Jul 01, 2022 2:33 am

Wed Sep 21, 2022 7:35 pm

Thank you! This got me 90% of the way there, the only extra step I had to do was adding the following package:

SkiaSharp.NativeAssets.Linux.NoDependencies

If I did not have that package I would get an 'Unable to load shared library 'libSkiaSharp' error. But now I am working to continue the evaluation.

mdudgeon
 
Posts: 2
Joined: Tue Sep 20, 2022 9:19 pm

Thu Sep 22, 2022 8:39 am

Hello,

Thanks for your feedback.
Yes, in some Linux environment, it needs to add SkiaSharp.NativeAssets.Linux.NoDependencies to avoid the libSkiaSharp mistakes. If you have any other questions during the evaluation, please feel free to contact us.

Sincerely,
Simple
E-iceblue support team
User avatar

Simple.Li
 
Posts: 248
Joined: Fri Jul 01, 2022 2:33 am

Return to Spire.XLS