Aspose.Cell is not working with .Net 6

I am using Aspose.Cells to export excel functionality from html string in .Net 6, it is working fine the first time downloading a file but if I try a second time to download it is getting an error as below.

Our project is container image based and Linux server.

Error :Unhandled exception. System.TypeInitializationException: The type initializer for ‘SkiaSharp.SKObject’ threw an exception.

System.DllNotFoundException: Unable to load shared library ‘libSkiaSharp’ or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: Error loading shared library liblibSkiaSharp: No such file or directory,at SkiaSharp.SkiaApi.sk_version_get_milestone()at SkiaSharp.SkiaSharpVersion.get_Native()

My current Version : Aspose.cells 22.12.0

Please reply as soon as possible.

Thanks

Riyaz Ahamed J

@riyazahamedj0101,

We recommend using newer versions to work on .NET6.0 for non Windows os. Aspose.Cells now also provides .NET6.0 library that uses SkiaSharp as the graphics library, as recommended in official statement of Microsoft. For more details about using Aspose.Cells with NET6, please see the documents.

Please try using our latest version/fix: Aspose.Cells for .NET v23.3 (Releases | NuGet).

In case you still find the issue, kindly do provide a sample project to reproduce the issue, we will check it soon.

I have updated latest version as Aspose.cell 23.3.0 but still getting same error.

We are not getting error in local machine but we are getting error after deploy the server that is 2nd time download only getting error as 502 bad gateway error.

Please suggest me

@riyazahamedj0101

It is strange that it works OK for the first time, but throws such initialization exception for the second time.

Could you please share us a sample project with docker file to reproduce the issue?

Thanks for your support, it is working as expected now after the below step followed.
Fix:

  1. version updated as Aspose.cell 23.3.0
  2. Add the nuget packages “SkiaSharp.NativeAssets.Linux 2.88.3”
  3. Docker file updated as ```
    RUN apk update && apk add fontconfig

@riyazahamedj0101,
I’m glad your issue has been solved, and thank you for sharing the solution. If you have any questions, please feel free to contact us.