Skip to content

System.TypeInitializationException: The type initializer for 'HtmlRendererCore.PdfSharp.Adapters.PdfSharpAdapter' threw an exception. #5

@eliyasbaby

Description

@eliyasbaby

Getting below exception on using this package when deploy to Linux server

System.TypeInitializationException: The type initializer for 'HtmlRendererCore.PdfSharp.Adapters.PdfSharpAdapter' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Gdip' threw an exception. ---> System.PlatformNotSupportedException: System.Drawing.Common is not supported on non-Windows platforms. See https://aka.ms/systemdrawingnonwindows for more information. at System.Drawing.LibraryResolver.EnsureRegistered() at System.Drawing.SafeNativeMethods.Gdip.PlatformInitialize() at System.Drawing.SafeNativeMethods.Gdip..cctor() --- End of inner exception stack trace --- at System.Drawing.SafeNativeMethods.Gdip.GdipNewInstalledFontCollection(IntPtr& fontCollection) at HtmlRendererCore.PdfSharp.Adapters.PdfSharpAdapter..ctor() at HtmlRendererCore.PdfSharp.Adapters.PdfSharpAdapter..cctor() --- End of inner exception stack trace --- at HtmlRendererCore.PdfSharp.Adapters.PdfSharpAdapter.get_Instance() at HtmlRendererCore.PdfSharp.HtmlContainer..ctor() at HtmlRendererCore.PdfSharp.PdfGenerator.AddPdfPages(PdfDocument document, String html, PdfGenerateConfig config, CssData cssData, EventHandler1 stylesheetLoad, EventHandler1 imageLoad) at HtmlRendererCore.PdfSharp.PdfGenerator.GeneratePdf(String html, PdfGenerateConfig config, CssData cssData, EventHandler`1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions