I try run app on dotnet 2.1 (ubuntu), but its show errors. How solve it? 21.3.0
In .NET Standard version of Aspose.Words SkiaSharp is used to work with graphics. Please add SkiaSharp.NativeAssets.Linux package to your project to fix this issue. Hope this helps you.
same issue. I add this nuget package.
Unhandled Exception: System.TypeInitializationException: The type initializer for ’ ’ threw an exception. —> System.TypeInitializationException: The type initializer for ‘SkiaSharp.SKImageInfo’ 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: liblibSkiaSharp: cannot open shared object file: No such file or directory
at SkiaSharp.SkiaApi.sk_colortype_get_default_8888()
at SkiaSharp.SKImageInfo…cctor()
— End of inner exception stack trace —
at SkiaSharp.SKBitmap…ctor(Int32 width, Int32 height, Boolean isOpaque)
at …cctor()
— End of inner exception stack trace —
at Aspose.Words.Document (Stream , LoadOptions )
at Aspose.Words.Document…ctor(Stream stream, LoadOptions loadOptions)
at MailGrabber.Program.Main(String[] args) in C:\Users\User\Desktop\mailgrabber\MailGrabber\MailGrabber\Program.cs:line 99
Aborted
It seems SkiaSharp native assets are not deployed properly.
If you add refference to SkiaSharp.NativeAssets.Linux, you should also install libfontconfig1
in your system. SkiaSharp.NativeAssets.Linux depends on this library. You can use the following command to install it:
apt-get update && apt-get install -y libfontconfig1
If you do not have rights to install packages, or other reasons not to install libfontconfig1
, you can simply use SkiaSharp.NativeAssets.Linux.NoDependencies, which does not require installation of libfontconfig1
.
Please let us know if you still face any issue while using Aspose.Words.