I cannot share, because it’s not a docker solution,
but I can describe all the steps to reproduce.
Short Description
Deploy self-contained .NET package to the azure python 3.10 application service with libfontconfig1 and libfreetype6 installed and see that application is failing to run with the next error:
terminate called after throwing an instance of ‘std::logic_error’
what(): basic_string::_M_construct null not valid
Aborted (core dumped)
When executed empty pdf file is generated, so library is actually called but cannot be used because of this critical error
Windows build is working fine with the same powerpoint file.
Details
Next code is used:
using (var presentation = new Aspose.Slides.Presentation(sourcePresentation))
{
// save the presentation to PDF
presentation.Save(outputFile, Aspose.Slides.Export.SaveFormat.Pdf);
}
Project settings:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>tool</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Aspose.Slides.NET6.CrossPlatform" Version="23.11.0" />
</ItemGroup>
</Project>
Self-contained package is created in windows using next command:
dotnet publish -r linux-x64 -o ../backend/tools/linux-x64 -c Release --self-contained true -p:PublishSingleFile=true
Environment
Create next azure service:
web app service python 3.10
This will deploy next env:
PRETTY_NAME=“Debian GNU/Linux 11 (bullseye)”
NAME=“Debian GNU/Linux”
VERSION_ID=“11”
VERSION=“11 (bullseye)”
VERSION_CODENAME=bullseye
ID=debian
Deploy application: Self-contained .net tool package and powerpoint slides example using next command
az webapp up --name {your web app name}
-
Connect in azure using ssh (there is an option in the web app interface)
-
Install next packages
sudo apt-get install libfontconfig1
sudo apt-get install libfreetype6
- Try to run tool to convert example powerpoint
You might have issue with failing to resolve is packed as self-contained package.
To avoid using ‘import native libraries bug’ libraries that are distributed are renamed from libaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23 to liblibaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23 and next path is set before executing a tool:
export LD_LIBRARY_PATH=/home/site/wwwroot/
After that whel all libraries references are resolved I have next exception:
terminate called after throwing an instance of ‘std::logic_error’
what(): basic_string::_M_construct null not valid
Aborted (core dumped)
Empty pdf is created.