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

Installs harfbuzz-dev library

RUN apk add --no-cache harfbuzz-dev

RUN apk add krb5-libs libgcc libintl libssl3 libstdc++ zlib
RUN apk --no-cache add libgdiplus

add “fontconfig” package if using “SkiaSharp.NativeAssets.Linux” in your project

Or you need to use “SkiaSharp.NativeAssets.Linux.NoDependencies” in your project

RUN apk update && apk add fontconfig

Installs icu library

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.