Running a C# Azure Functions app on a Premium Elastic Plan using Linux, leveraging some DevExpress libraries that help manipulate MS Office files and PDFs, which apparently depend on gdiplus and I cannot seem to get this thing resolved.
We input the following via the Azure Portal for the Function App -> Configuration -> General settings -> Stack settings -> Startup Command:
sudo apt-get update && sudo apt-get install -y software-properties-common && sudo add-apt-repository 'deb http://deb.debian.org/debian bullseye main' && sudo apt-get update && sudo apt-get install -y libc6-dev && sudo apt-get install -y libgdiplus && sudo apt-get install -y libicu-dev && sudo apt-get install -y libharfbuzz0b && sudo apt-get install -y libfontconfig1 && sudo apt-get install -y libfreetype6 && sudo apt-get install -y libpango-1.0-0 && sudo apt-get install -y libpangocairo-1.0 && dotnet MyFunctionApp.dll
- tried the above with and without sudo, made no difference, still get the exception below
- tried entering the above as wrapped in double quotes and prefixed with -c in case it mattered (as that gets passed to docker run command), no difference
"Message":"An error has occurred.","ExceptionMessage":"The type initializer for 'DevExpress.Text.Fonts.GDIFontSubstitutionEngine' threw an exception.","ExceptionType":"System.TypeInitializationException","StackTrace":" at DevExpress.Pdf.ContentGeneration.PdfExportFontManager.GetMatchingFont(PdfSetTextFontCommand setTextFontCommand)\n at DevExpress.Pdf.PdfInteractiveFormField.GetFontInfo(IPdfExportFontProvider fontSearch)\n at DevExpress.Pdf.Native.PdfTextBasedFormFieldAppearanceBuilder`1..ctor(PdfWidgetAnnotation widget, T formField, IPdfExportFontProvider fontSearch, PdfRgbaColor backgroundColor)\n at DevExpress.Pdf.Native.PdfWidgetAppearanceBuilderFactory.DevExpress.Pdf.Native.IPdfInteractiveFormFieldVisitor.Visit(PdfTextFormField formField)\n at DevExpress.Pdf.PdfWidgetAnnotation.CreateAppearanceBuilder(IPdfExportFontProvider fontSearch)\n at DevExpress.Pdf.PdfAnnotation.EnsureAppearance(PdfAnnotationAppearanceState appearanceState, PdfDocumentStateBase documentState, PdfForm form)\n
at DevExpress.Pdf.PdfWidgetAnnotation.EnsureAppearance(PdfDocumentStateBase documentState)\n at DevExpress.Pdf.Native.PdfDocumentStateBase.CreateFormData(PdfInteractiveFormField field)\n at DevExpress.Pdf.Native.PdfDocumentStateBase.CreateFormData()\n,"InnerException":{"Message":"An error has occurred.","ExceptionMessage":"The type initializer for 'Gdip' threw an exception.","ExceptionType":"System.TypeInitializationException","StackTrace":" at System.Drawing.SafeNativeMethods.Gdip.GdipNewInstalledFontCollection(IntPtr& fontCollection)\n at DevExpress.Text.Fonts.GDIFontSubstitutionEngine.CreateFromGDIPlus()\n at DevExpress.Text.Fonts.GDIFontSubstitutionEngine..cctor()","InnerException":{"Message":"An error has occurred.","ExceptionMessage":"Unable to load shared library 'libgdiplus' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibgdiplus: cannot open shared object file: No such file or directory","ExceptionType":"System.DllNotFoundException","StackTrace":" at System.Drawing.SafeNativeMethods.Gdip.GdiplusStartup(IntPtr& token, StartupInput& input, StartupOutput& output)\n at System.Drawing.SafeNativeMethods.Gdip..cctor()"}}}
Any ideas? I cannot install WSL on this machine to debug locally either. Appreciate any tips.