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

Free Support Forum - aspose.com

Document.UpdateFields always crashes for files with objects in docker environment

We are using Aspose.Words for .NET. Calling Document.UpdateFields on a docx file that contains objects results in a crash in a linux docker environment. The bug does not occur in a windows environment.

Find attached a Visual Studio 2017 solution and docker file that show this problem.
Steps to reproduce:
On windows)

  • build solution
  • run application
  • message “success with test.docx” shown (OK)

Docker)

  • build image using dockerfile
  • start container in linux environment
  • call application and see error message (Bug)

Example.zip (1.2 MB)

@IBP

Please note that .NET Standard 2.0 version of Aspose.Words uses SkiaSharp to deal with graphics. To make it work in Linux container it is required to add Linux native Skia library. Please add reference to SkiaSharp.NativeAssets.Linux .

We tried to add the reference. The error remains the same.

Also note that this problem is a regression. In Version 18.7 the problem does not occur (even without the SkiaSharp reference).

@IBP

Thanks for your inquiry. MS Word 2016 does not open the input document. Could you pleas ZIP and attach the correct document for testing?

Sorry for the inconvenience. The file has the wrong extension. Please change the file extension to “.doc” and adjust HomeController.cs accordingly.

We tried to reproduce the problem with a docx file and weren’t able. This could mean that the problem affects doc files only.

@IBP

Thanks for sharing the detail. We will investigate this issue at Linux operating system and will share our findings with you as soon as possible.

We were able to resolve the issue. Apparently the binaries in the SkiaSharp.NativeAssets.Linux-Nuget-Package are not compatible with the linux distribution used in the image. We build SkiaSharp ourselves and the error no longer occurs.
It’s a bit unfortunate that this is necessary for microsoft’s .net core images.

@IBP

It is nice to hear from you that you have figured out your issue. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.