我正在尝试使用 DinkToPdf 从 HTML SQL 服务器数据库生成 PDF图书馆。
在我添加的启动文件中:
var context = new CustomAssemblyLoadContext();
context.LoadUnmanagedLibrary(Path.Combine(Directory.GetCurrentDirectory(), "libwkhtmltox.dll"));
该行在启动网络应用程序时给我这个错误:
DllNotFoundException: Unable to load DLL 'C:\Program Files\IIS Express\libwkhtmltox.dll' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
System.Runtime.Loader.AssemblyLoadContext.InternalLoadUnmanagedDllFromPath(string unmanagedDllPath)
DllNotFoundException: Unable to load DLL 'C:\Program Files\IIS Express\libwkhtmltox.dll' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
最佳答案
为了防止其他人遇到同样的问题,我可以通过安装 Microsoft Visual C++ 2015 Redistributable 来解决它。
关于c# - DinkToPdf Net Core 无法加载 DLL 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55430532/