question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

System.DllNotFoundException: Unable to load DLL 'libwkhtmltox' when deploying on Windows 2016

See original GitHub issue

Hi,

I saw this use case was already mentioned in other issues but I found a strange workaround.

So first some information about my environment : I’m using DinkToPdf along with some fixes provided by #18 . Everything work natively with VS2017 in a .net core 2.0 (AspNet core), I can generate any PDF I want without any problem, any errors (and without loading explicitly any DLL).

I deployed it on a Windows 2016 Server and I got the infamous System.DllNotFoundException. I tried a lot of things but finally I added in the root of my project the libwkhtmltox.dll coming from the 0.12.3.2 windows 64bits package. And it worked perfectly fine. Swapping it with 0.12.4 does not work at all (DllNotFoundException). I tried to use the latest alpha and even if I did not have a System.DllNotFoundException, I didn’t get any PDF output (did not spend any time debugging it).

If I read wkhtmltox changelog they switched from VS2013 to VS2015 with 0.12.4.

Can somebody with access to Windows server 2016 test and confirm ?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:5

github_iconTop GitHub Comments

3reactions
zulander1commented, Aug 25, 2018

I am having the same issue any work around ?

fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[0] An unhandled exception has occurred: One or more errors occurred. (Unable to load DLL ‘libwkhtmltox’: The specified module could not be found. (Exception from HRESULT: 0x8007007E)) System.AggregateException: One or more errors occurred. (Unable to load DLL ‘libwkhtmltox’: The specified module could not be found. (Exception from HRESULT: 0x8007007E)) —> System.DllNotFoundException: Unable to load DLL ‘libwkhtmltox’: The specified module could not be found. (Exception from HRESULT: 0x8007007E) at DinkToPdf.WkHtmlToXBindings.wkhtmltopdf_init(Int32 useGraphics)

@seblucas: Installed 0.12.3.2 from download site to server not working …

Solved: Found the issue after spending 8 hours !!! Brand new server missing microsoft visual c++ 2010 redistributable package (x64)

1reaction
hugoterellecommented, May 9, 2018

Version 0.12.4 on Windows 2016 server (Azure VM) works for us.

See https://github.com/rdvojmoc/DinkToPdf/issues/5

Solution is to download and install the tool on your server https://wkhtmltopdf.org/downloads.html

Read more comments on GitHub >

github_iconTop Results From Across the Web

DinkToPdf dll not found libwkhtmltox
DllNotFoundException: Unable to load DLL 'libwkhtmltox' or one of its dependencies: The specified module could not be found. (0x8007007E).
Read more >
Convert html to PDF Unable to load DLL 'wkhtmltox.dll'
Hi, I moved my Custom Solutions to new SharePoint 2016 Server ... to load DLL 'wkhtmltox.dll': The specified module could not be found....
Read more >
[Solved]-System.DllNotFoundException: 'Unable to load DLL ...
Coding example for the question System.DllNotFoundException: 'Unable to load DLL 'libwkhtmltox': The specified module could not be found.
Read more >
System.DllNotFoundException: Access is denied
Failing process is hosted by IIS 8 on Windows server 2012. ... System.DllNotFoundException: Unable to load DLL 'libSkiaSharp' or one of its dependencies: ......
Read more >
Net Core PDF Library from HTML (DinkToPdf) - Jannik Strelow
An unhandled exception has occurred while executing the request. System.AggregateException: One or more errors occurred. (Unable to load DLL ' ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found