We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.words.Net throwing Exception after deploying application on Cloud Foundry

Hi Team,

Getting below exception when we deploy application on Cloud Foundry. It works fine locally and when we deploy it on CF its throwing below exception.

2020-02-06T17:14:11.91+0530 [APP/PROC/WEB/0] ERR Unhandled Exception: System.TypeInitializationException: The type initializer for ‘SkiaSharp.SKObject’ threw an exception. —> System.TypeInitializationException: The type initializer for ‘SkiaSharp.SKColorSpace’ 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
2020-02-06T17:14:11.91+0530 [APP/PROC/WEB/0] ERR at SkiaSharp.SkiaApi.sk_colorspace_new_srgb()
2020-02-06T17:14:11.91+0530 [APP/PROC/WEB/0] ERR at SkiaSharp.SKColorSpace…cctor()
2020-02-06T17:14:11.91+0530 [APP/PROC/WEB/0] ERR — End of inner exception stack trace —
2020-02-06T17:14:11.91+0530 [APP/PROC/WEB/0] ERR at SkiaSharp.SKColorSpace.EnsureStaticInstanceAreInitialized()
2020-02-06T17:14:11.91+0530 [APP/PROC/WEB/0] ERR at SkiaSharp.SKObject…cctor()
2020-02-06T17:14:11.91+0530 [APP/PROC/WEB/0] ERR — End of inner exception stack trace —
2020-02-06T17:14:11.91+0530 [APP/PROC/WEB/0] ERR at SkiaSharp.SKObject.DeregisterHandle(IntPtr handle, SKObject instance)
2020-02-06T17:14:11.91+0530 [APP/PROC/WEB/0] ERR at SkiaSharp.SKObject.set_Handle(IntPtr value)
2020-02-06T17:14:11.91+0530 [APP/PROC/WEB/0] ERR at SkiaSharp.SKNativeObject.Dispose(Boolean disposing)
2020-02-06T17:14:11.91+0530 [APP/PROC/WEB/0] ERR at SkiaSharp.SKNativeObject.Finalize()

Thanks,
Mallikarjun.

@mallikarjun.sidveer

You are facing this issue because Aspose.Words is not completely installed at Cloud Foundry. The System.DllNotFoundException shows that SkiaSharp.dll is missing where you are using Aspose.Words’ API. We suggest you please install Aspose.Words for .NET through NuGet at your local system and deploy all DLLs at Cloud Foundry.

Hello Tahir,

I Have installed Aspose.Words through nuget only. And I published application on CF.
Same publish is working on windows but when I publish on CF its throwing DLL not found exception.Nuget.PNG (3.9 KB)

@mallikarjun.sidveer There can be two reasons of the problem. The first is SkiaSharp native assets are not published properly. The similar problem was encountered upon deploying to Azure. The solution of this problem is described here

The second possible reason is that you test on Windows but deploy to Linux, in this case Linux native assets for Linux are missed. If this is the reason of the problem then you should add reference to SkiaSharp.NativeAssets.Linux.NoDependencies

Hope this helps. Please let me know in case of any issues.