1
votes

I have a net core 2.0.3 project with aspose words 18.0.1 and skiasharp 1.59.1 that works fine on my computer but iam trying to run my project on openshift and getting the following exception:

The type initializer for ‘SkiaSharp.SKImageInfo’ threw an exception.

The inner exception iam getting is

Unable to load DLL ‘libSkiaSharp’: The specified module or on of its dependencies could not be found

Here is my code:

public string PostWord(IFormFile file)
{
try
{
using(MemoryStream postFile = new MemoryStream())
using(MemoryStream htmlStream = new MemoryStream())
using(MemoryStream xmlStream = new MemoryStream())
{
file.CopyTo(postFile);
Document doc = new Document(postFile);
doc.Save(xmlStream, SaveFormat.WordML);

doc.Save(htmlStream, new HtmlSaveOptions { 
ExportImageAsBase64 = true, 
Encoding = Encoding.UTF8, 
SaveFormat = SaveFormat.Html });
 return "succ"; 
}
 }
 catch (System.Exception e) 
{ return e.Message; } } 

any idea why this happens?

1

1 Answers

0
votes

Please uninstall/delete all old Aspose.Words.dll references from your Visual Studio project (and related DLLs from Bin folder). After that please use NuGet Package Manager UI to install Aspose.Words for .NET NuGet package. This will also install external references such as SkiaSharp to your project. I work with Aspose as Developer Evangelist.