We're using EvoPDF in an NET6 C# MVC application to convert HTML to PDF files for display and emailing as attachments.
Using EvoPdf.HtmlToPdf.NetCore in our development environment works fine. If we publish from Visual Studio using Deployment Mode = Framework-dependent then EvoPdf works ok.
If we publish from Visual Studio using Deployment Mode = Self-contained and run EvoPdf we get an error
Could not create image object. Could not load type 'System.StubHelpers.InterfaceMarshaler' from assembly 'System.Private.Corelib, Version=6.0.0.0, Culture=neutral, ....
As we'd rather have a self-contained install on our Live servers this is a major pain !
Any suggestions gratefully received.
I have same issue, you can try uncheck
Trim unused codeoption in publish setting. you can use dnspy load this dll & searchInterfaceMarshalercheck whether it exists in published dll, maybe it exists in debug folder but not exists in publish folder.System.Private.CoreLib.dll take 10.4MB size in dotnet 7.0 shared directory.
You can simply copy dll from shared directory to publish directory.