Unable to Load Shared Library 'libaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23'

    Unhandled exception. System.DllNotFoundException: Unable to load shared library 'libaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23: cannot open shared object file: No such file or directory
2023-08-08 00:21:16    at System.Runtime.InteropServices.NativeLibrary.LoadByName(String libraryName, QCallAssembly callingAssembly, Boolean hasDllImportSearchPathFlag, UInt32 dllImportSearchPathFlag, Boolean throwOnError)
2023-08-08 00:21:16    at System.Runtime.InteropServices.NativeLibrary.LoadLibraryByName(String libraryName, Assembly assembly, Nullable`1 searchPath, Boolean throwOnError)
2023-08-08 00:21:16    at System.Runtime.InteropServices.NativeLibrary.Load(String libraryName, Assembly assembly, Nullable`1 searchPath)
2023-08-08 00:21:16    at .(String , Assembly , Nullable`1 )
2023-08-08 00:21:16    at System.Runtime.InteropServices.NativeLibrary.LoadLibraryCallbackStub(String libraryName, Assembly assembly, Boolean hasDllImportSearchPathFlags, UInt32 dllImportSearchPathFlags)
2023-08-08 00:21:16    at .a(Int32 a, Int32 b, Int32 c, IntPtr& d)
2023-08-08 00:21:16    at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
2023-08-08 00:21:16    at .(ShapeThumbnailBounds , Single , Single )
2023-08-08 00:21:16    at .(Object )
2023-08-08 00:21:16    at .(Object )
2023-08-08 00:21:16    at .(MethodBase , Boolean )
2023-08-08 00:21:16    at ( ,  )
2023-08-08 00:21:16    at .()
2023-08-08 00:21:16    at .(Boolean )
2023-08-08 00:21:16    at .(Object )
2023-08-08 00:21:16    at .(Object )
2023-08-08 00:21:16    at .()
2023-08-08 00:21:16    at .(Boolean )
2023-08-08 00:21:16    at .(Object[] , Type[] , Type[] , Object[])
2023-08-08 00:21:16    at .(Stream , String , Object[] , Type[], Type[] , Object[] )
2023-08-08 00:21:16    at .(Stream , String , Object[] )
2023-08-08 00:21:16    at Aspose.Slides.Shape.GetThumbnail(ShapeThumbnailBounds bounds, Single scaleX, Single scaleY)
2023-08-08 00:21:16    at Aspose.Slides.Shape.GetThumbnail()
2023-08-08 00:21:16    at Aspose.Slides.WebExtensions.Helpers.ShapeHelper.GetShapeAsImageURL[T](T shape, TemplateContext`1 model) in /src/Aspose.Slides.WebExtensions/Helpers/ShapeHelper.cs:line 21
2023-08-08 00:21:16    at RazorLight.CompiledTemplates.GeneratedTemplate.ExecuteAsync() in shape:line 7
2023-08-08 00:21:16    at RazorLight.TemplateRenderer.RenderPageCoreAsync(ITemplatePage page, PageContext context) in /src/RazorLight/TemplateRenderer.cs:line 104
2023-08-08 00:21:16    at RazorLight.TemplateRenderer.RenderPageAsync(ITemplatePage page, PageContext context, Boolean invokeViewStarts) in /src/RazorLight/TemplateRenderer.cs:line 82
2023-08-08 00:21:16    at RazorLight.TemplateRenderer.RenderAsync(ITemplatePage page) in /src/RazorLight/TemplateRenderer.cs:line 36
2023-08-08 00:21:16    at RazorLight.EngineHandler.RenderIncludedTemplateAsync[T](ITemplatePage templatePage, T model, TextWriter textWriter, ExpandoObject viewBag, TemplateRenderer templateRenderer) in /src/RazorLight/EngineHandler.cs:line 128
2023-08-08 00:21:16    at RazorLight.TemplateRenderer.<>c__DisplayClass6_0.<<RenderPageCoreAsync>b__0>d.MoveNext() in /src/RazorLight/TemplateRenderer.cs:line 99
2023-08-08 00:21:16 --- End of stack trace from previous location ---

Dockerfile

FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

# Build Stage
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS install
WORKDIR /src

# Install required packages
RUN apt-get update && apt-get install -y \
    libgdiplus \
    libc6-dev \
    libfontconfig1 \
    libfreetype6 \
    libexpat1 \
    libpng16-16

# Copy the entire project directory into the container
FROM install AS build
WORKDIR /src
COPY . .
# Build the application
RUN dotnet restore "./SparticleFileParser/SparticleFileParser.csproj"
RUN dotnet build "./SparticleFileParser/SparticleFileParser.csproj" -c Release -o /app/build

# Publish Stage
FROM build AS publish
RUN dotnet publish "./SparticleFileParser/SparticleFileParser.csproj" -c Release -o /app/publish /p:UseAppHost=false

# Final Stage
FROM base AS final
WORKDIR /app

# Copy only the necessary artifacts from the publish stage
COPY --from=publish /app/publish .

ENTRYPOINT ["dotnet", "SparticleFileParser.dll"]

Config

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
    <UserSecretsId>05aa92e6-98c3-41ae-9edc-9b1b1812b90b</UserSecretsId>
    <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
	<PreserveCompilationContext>true</PreserveCompilationContext>
	<MvcRazorCompileOnPublish>false</MvcRazorCompileOnPublish>
	<MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish>
	<OutputType>Exe</OutputType>
  </PropertyGroup>

  <ItemGroup>
    <None Include="Program.cs" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Aspose.Cells" Version="23.7.0" />
    <PackageReference Include="Aspose.OCR" Version="23.7.1" />
    <PackageReference Include="Aspose.PDF" Version="23.7.0" />
    <PackageReference Include="Aspose.Words" Version="23.8.0" />
    <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.18.1" />
    <PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.3" />
    <PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\Aspose.Slides.WebExtensions\Aspose.Slides.WebExtensions.csproj" />
  </ItemGroup>

  <ItemGroup>
    <None Update="aspose.slides.drawing.capi_vc14x64.dll">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="aspose.slides.drawing.capi_vc14x86.dll">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="libaspose.slides.drawing.capi_appleclang.dylib">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="libaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23.so">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
  </ItemGroup>
  <ItemGroup>
	<Content Include="./Templates/**">
		<CopyToPublishDirectory>Always</CopyToPublishDirectory>
		<CopyToOutputDirectory>Always</CopyToOutputDirectory>
	</Content>
  </ItemGroup>
  <ItemGroup>
    <Reference Include="Aspose.Slides">
      <HintPath>..\Libs\Aspose.Slides.dll</HintPath>
    </Reference>
  </ItemGroup>
</Project>

image.png (197.6 KB)

Same goes for version 23.7 23.6 23.5

OS: Debian GNU/Linux 11

The reason is that the libfontconfig1 in the dockerfile is not installed successfully, just go to the server and install it again

But now there is a new problem when the shape is of type Aspose.Slides.GroupShape

(shape as Shape). GetThumbnail();

This line of code breaks without any error message

@aomao,
Thank you for contacting support.

Could you please share a complete code example that reproduces the problem and a sample PowerPoint presentation?

I am currently working on converting PPTX files to HTML format.

My current approach involves excluding calls to the Aspose.Slides.GroupShape type in the code. It seems to represent the background area of the PPTX slide.

I have based my work on the code from https://github.com/aspose-slides/Aspose.Slides.WebExtensions, but I have adapted it for .NET 6 and removed RazorEngine, replacing it with the RazorLight library. Due to these changes and local modifications, the project has become quite complex, making it difficult for me to provide a reproducible example.

The code that triggers the error is the same as in this section: https://github.com/aspose-slides/Aspose.Slides.WebExtensions/blob/main/Aspose.Slides.WebExtensions/Helpers/ShapeHelper.cs#L25.

The issue arises when the shape is of type Aspose.Slides.GroupShape.

It can be reproduced by using the demo file that comes with office

@aomao,
Thank you for the additional information.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESNET-44135

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@aomao,
Unfortunately, the issue information you provided is not enough to reproduce the problem on our end and help you. We need a sample project.