Hi Aspose Team,
We are facing an issue on Linux related to file conversion and stamping using Aspose libraries.
Environment Details
- .NET Core: 3.1
- OS: Linux (Amazon Linux 2)
- Aspose Versions:
- File Conversion → Aspose 21.6
- Stamping → Aspose 22.12.0
- SkiaSharp Versions: 2.80.3 (SkiaSharp.NativeAssets.Linux 2.80.3)
Workflow
- FileConversion job → Converts files to PDF using Aspose 21.6.
- Stamping job → Processes converted PDFs using Aspose 22.12.0.
Both projects target .NET Core 3.1.
Project Files
FileConversion.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Aspose.PDF" Version="21.6.0" />
<PackageReference Include="Aspose.Words" Version="21.6.0" />
<PackageReference Include="Aspose.Cells" Version="21.6.0" />
<PackageReference Include="Aspose.Email" Version="21.6.0" />
<PackageReference Include="Aspose.Imaging" Version="21.6.0" />
<PackageReference Include="Aspose.Slides.NET" Version="21.6.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.5" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.32" />
<PackageReference Include="SkiaSharp" Version="2.80.3" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.80.3" />
</ItemGroup>
</Project>
StampingJob.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Magick.NET-Q16-AnyCPU" Version="13.1.3" />
<PackageReference Include="PdfSharp.Core" Version="1.0.0" />
<PackageReference Include="PdfiumViewer" Version="2.13.0" />
<PackageReference Include="AWSSDK.Textract" Version="3.7.501.4" />
<PackageReference Include="Aspose.PDF" Version="22.12.0" />
</ItemGroup>
</Project>
Issue Observed
- When running file conversion or stamping jobs, the Linux server restarts unexpectedly.
- Hangfire marks jobs as completed, but no processing occurs.
- Initially, we got this error:
Oct 24 15:56:57 ip-x-x-x-x.us-east-2.compute.internal x-x[2868]: Unhandled exception. System.TypeInitializationException: The type initializer for 'SkiaSharp.SKObject' threw an exce
Oct 24 15:56:57 ip-x-x-x-x.us-east-2.compute.internal x-x[2868]: ---> System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies. In order
Oct 24 15:56:57 ip-x-x-x-x.us-east-2.compute.internal x-x[2868]: at SkiaSharp.SkiaApi.sk_version_get_milestone()
Oct 24 15:56:57 ip-x-x-x-x.us-east-2.compute.internal x-x[2868]: at SkiaSharp.SkiaSharpVersion.get_Native()
Oct 24 15:56:57 ip-x-x-x-x.us-east-2.compute.internal x-x[2868]: at SkiaSharp.SkiaSharpVersion.CheckNativeLibraryCompatible(Boolean throwIfIncompatible)
Oct 24 15:56:57 ip-1x0x12-x-x.us-east-2.compute.internal x-x[2868]: at SkiaSharp.SKObject..cctor()
- After installing required dependencies:
sudo yum install -y cairo cairo-devel pango pango-devel freetype freetype-devel libpng libpng-devel
sudo yum install -y skia-sharp
The error disappeared, but the jobs appear as completed in Hangfire while the actual file conversion does not take place .
On Windows, the same workflow works without any issues.
Questions / Guidance Needed
- Are there additional native dependencies or configurations required for SkiaSharp / Aspose on Linux?
- Could mixing Aspose 21.6 (conversion) and Aspose 22.12 (stamping) cause compatibility issues?
- Would upgrading both projects to a consistent Aspose version help?
This issue is currently blocking our production workflow. Any guidance, workaround, or recommendation to get file conversion and stamping working reliably on Linux would be greatly appreciated.
Thanks in advance,