The Type Initializer for '\u0005\u0015\u0019\u0005' Threw an Exception

Hello Team,

We are using the ‘Aspose.Slides.NET6.CrossPlatform’ package and trying to convert PPT slides into the pdf then we are getting - ‘The type initializer for ‘\u0005\u0015\u0019\u0005’ threw an exception’ this issue. Locally it’s working but whenever we deploying our code to linux server then this issue is coming.


Info

  1. .Net version - .Net core 8.0
  2. Server - Linux
  3. Alpine version - 3.19
  4. GLIBC version - Installed 2.23 version on alpine server

Sample Program code

[HttpPost()]
public async Task<IActionResult> UploadPPTFile(IFormFile file)
{
    Presentation presentation = new Presentation(file.OpenReadStream());
    presentation.Save("PDF-result.pdf", SaveFormat.Pdf);

    return new ObjectResult($"PDF converted successfully.")
    {
        StatusCode = 201
    };
}

Jenkinsfile

FROM icr.io/ic-devops/ic-dotnet-aspnet:8.0.3-alpine3.19
WORKDIR /app
EXPOSE 8080
RUN apk add --no-cache harfbuzz-dev
RUN apk add krb5-libs libgcc libintl libssl3 libstdc++ zlib
RUN apk --no-cache add libgdiplus
RUN apk update && apk add fontconfig
RUN apk add --no-cache icu-libs
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
ENV ASPNETCORE_URLS=http://*:8080;http://*:8081
RUN addgroup -g 2000 -S appuser && adduser -u 1000 -S appuser -G appuser -h /app
RUN chown appuser:appuser  /app /tmp
USER appuser:appuser
ARG CSPROJ_PATH
COPY --chown=appuser:appuser PPT.Api .
ENTRYPOINT ["dotnet", "PPT.Api.dll"]

@sfulari,
Thank you for contacting free support. I need some time to check the problem. I will get back to you soon.

@sfulari,
Thank you for your patience. Unfortunately, the image icr.io/ic-devops/ic-dotnet-aspnet:8.0.3-alpine3.19 is hosted in a private registry. Could you please share a standalone sample project to reproduce the error?

See this solution
Pune.Aspose.Slides.zip (1.3 MB)

@sfulari,
Thank you for the sample project.

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-44736

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.

1 Like

Issue ID(s): SLIDESNET-44736

Any update on this Ticket? 21 Days is gone and we are still waiting on this ticket. We already purchased Aspose Total license and this delay of time affecting our timeline.

@sfulari,
We are sorry that you have to encounter this problem. The issue is still open. Unfortunately, I don’t have any additional information yet. We apologize for any inconvenience caused.

Can you give us any ETA on this issue?

@sfulari,
Unfortunately, I don’t have information about ETA for the issue. I understand how frustrating it must be to wait without clear updates, and I’m here to help as much as I can in the meantime.

We have Enterprise Support as well, can we put this query/Ticket Number over to there? We want to quick resolution.

@sfulari,
Yes, please contact paid support and quote ticket number SLIDESNET-44736 to prioritize the issue.

Any progress on this issue?

@sfulari,
The issue is still open. We will keep you updated as soon as there is any progress. Thank you for your patience.

Can you escalate this issue with your team?

@sfulari,
The issue has been scheduled to be investigated this week. Unfortunately, I don’t have any additional information yet. I will keep you updated.

@sfulari,
Our developers have investigated the issue. The Aspose.Slides.NET6.CrossPlatform library is built against the standard glibc (GNU C Library), which is used by most popular Linux distributions such as Ubuntu, Debian, CentOS, RHEL, and others.

Alpine Linux, however, uses musl libc by default—an alternative implementation of the C standard library that is not binary-compatible with glibc. As a result, any native libraries compiled against glibc cannot be reliably executed on Alpine Linux.

Even if glibc is manually installed, stable and reliable operation of such libraries is not guaranteed due to the following reasons:

  • Alpine Linux does not officially support glibc.
  • glibc is not fully integrated with the rest of the system.
  • Conflicts with system dependencies may occur.

For use with Alpine Linux, we recommend using Aspose.Slides starting from version 25.3, which is compatible with this environment. The library is available on NuGet.

To ensure proper operation in a Linux environment, please follow these steps:

  • Install the libgdiplus package (for example, in Docker):
RUN apk add --no-cache libgdiplus
  • Enable support for System.Drawing.Common by setting the following flag:
AppContext.SetSwitch("System.Drawing.EnableUnixSupport", true);

We have prepared a demo project that has been tested in the following environments: Docker (based on Alpine), WSL (Alpine 3.17), and a virtual machine running Alpine 3.18.
SlidesAlpineDocker.zip (37.4 KB)