c# - DinkToPdf Net Core 无法加载 DLL 文件

标签 c# .net-core wkhtmltopdf html-to-pdf dinktopdf

我正在尝试使用 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/

相关文章:

c# - Picture Box 图片来源是否可能?

angular - 如何配置.net core以将身份验证cookie发送到不同的域

postgresql - .NET Core 使用 NLog 记录到 PostgreSQL DB

ruby-on-rails-4 - 使用包含表格标题的 PDFKit 开始一个新页面

php - 通过 php 执行命令行?

C# 枚举作为函数参数?

c# - 在 Canvas 上简单地绘制一个矩形

c# - 泛型/JSON JavaScriptSerializer C#

c# - IServiceProvider 垃圾收集/处理

Linux centos fontconfig 需要帮助