DinkToPdf Library Unable to load shared library 'Shell32.dll'

ε祈祈猫儿з 提交于 2021-02-11 17:04:30

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!