问题
I am using DinkToPdf Library for pdf generation, but I encountered on a problme on Debian 9. I changed CustomAssemblyLoadConext to load the .so file like this
#region DinkToPDF
#if DEBUG
string filePath = $@"{Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)}\libwkhtmltox.dll";
#else
string filePath = $@"{Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)}\libwkhtmltox.so";
#endif
CustomAssemblyLoadContext context = new CustomAssemblyLoadContext();
context.LoadUnmanagedLibrary(filePath);
serviceCollection.AddSingleton(typeof(IConverter), new SynchronizedConverter(new PdfTools()));
On Windows it is working perfect. On Linux (Debian 9) when I hit the controller to get a pdf file I got an error:
"Unable to load shared library 'Shell32.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libShell32.dll: cannot open shared object file: No such file or directory"
thnx
来源:https://stackoverflow.com/questions/61100502/dinktopdf-library-unable-to-load-shared-library-shell32-dll