.NET Core SkiaSharp.dll not found on Ubuntu

I’ve written a proof of concept application using Aspose.Words in .NET Core 2.0. I am running into an issue in with deploying the application on Ubuntu. I am attempting to convert HTML to DOCX and PDF. This works correctly when running in Visual Studio 2017 on Windows 10. However, when I publish my application and run it on Ubuntu, I get an error “Unable to load DLL ‘libSkiaSharp’: The specified module or one of its dependencies could not be found.” I found that Aspose.Words was referencing the SkiaSharp library when my HTML code has a “code” tag in it that is within <> brackets.
My HTML Code: Test document text…
something
I have installed the Nuget Package Aspose Words version 18.4.0, which includes SkiaSharp 1.59.1
I am unfamiliar with SkiaSharp. However, looking into SkiaSharp it appears as though it is not supported in .Net Core, and uses Mono libraries to run on Linux/Ubuntu. SkiaSharp (in the nuget repository) only has runtimes for Windows and OSX.
Do you have a solution for deploying Aspose.Words to .NET Core supported platforms or a simple solution for a SkiaSharp workaround in Ubuntu?

@marcuskarl,

Thanks for your inquiry. Could you please share the steps that you are following to publish the application on Ubuntu. We will investigate the issue at our end and provide you more information on it.

@tahir.manzoor,

I’m running an Ubuntu Shell on Windows 10.
From my project solution folder I am running “dotnet publish --output C:\Users\marcus.karl\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\home”.

From the Ubuntu shell I am going to the /home/PublishedProject directory and running “dotnet PublishedProject.dll”.

Please let me know if you need additional information.

@marcuskarl,

We have already logged this problem in our issue tracking system as WORDSNET-16749. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

@marcuskarl,

Thanks for your patience. This is not a bug. This is kind of limitation of SkiaSharp that is used by Aspose.Words .NET Standard version. SkiaSharp NuGet package does not contain native skia library for Linux, so it is required to add it manually.

  1. Create ne .NET Core Console Application
  2. Please install Aspose.Words for .NET through NuGet.
  3. Aspose.Words for .NET Standard uses SkiaSharp, which does not have native Skia library for Linux in its NuGet package yet. However, it is not a problem, because this native library is published with every SkiaSharp release on Github. Please note that Aspose.Words uses SkiaSharp 1.60.1, so download libHarfBuzzSharp.so file for this version. Once you download it, add it in your project and set “Copy to output directory”.
  4. Write code that uses Aspose.Words.
  5. Than open cmd line in folder where project file is and run this command:
  6. dotnet publish -r ubuntu.16.04-x64

    dotnet publish -r ubuntu.16.04-x64

  • Copy output ubuntu build folder to Ubuntu
  • Installing .NET Core 2.0 on Ubuntu (https://github.com/dotnet/docs/blob/master/docs/core/linux-prerequisites.md)
  • Open Ubuntu machine terminal (CLI) and Go to the project directory
  • Provide execute permissions:

    chmod 777 ./appname

  • Execute application

    ./appname

The issues you have found earlier (filed as WORDSNET-16749) have been fixed in this Aspose.Words for .NET 18.9 update and this Aspose.Words for Java 18.9 update.

A post was split to a new topic: .NET Core SkiaSharp issue on Ubuntu