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.

Unable to read DLL

See original GitHub issue

I tried making my own project to test this out. I downloaded the 64 bit dll from your link and tried putting it in three different places

  • The root folder (with the .csproj file)
  • The folder with the solution file (One above root folder)
  • The folder with the debug dll in it (bin\Debug\netcoreapp1.1)

I am still getting the same error: dllnotfound Is there somewhere else I should be putting the DLL? Thanks!

Edit: Here are the error details:

System.DllNotFoundException occurred
  HResult=0x80131524
  Message=Unable to load DLL 'libwkhtmltox': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
  Source=DinkToPdf
  StackTrace:
   at DinkToPdf.WkHtmlToXBindings.wkhtmltopdf_init(Int32 useGraphics)
   at DinkToPdf.PdfTools.Load() in C:\Users\admin\Documents\DinkToPdf\src\DinkToPdf\PdfTools.cs:line 27
   at DinkToPdf.BasicConverter.Convert(IDocument document) in C:\Users\admin\Documents\DinkToPdf\src\DinkToPdf\BasicConverter.cs:line 42
   at DinkToPdf.SynchronizedConverter.<>n__0(IDocument document)
   at DinkToPdf.SynchronizedConverter.<>c__DisplayClass5_0.<Convert>b__0() in C:\Users\admin\Documents\DinkToPdf\src\DinkToPdf\SynchronizedConverter.cs:line 27
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rdvojmoccommented, Jul 31, 2017
  • If your OS is 64 bit then this is correct behavior. If you want to test with 32 bit library you must run it in 32 bit environment.

  • In thread safe console did you get expected PDF at the end?

  • This is right route to get PDF: http://localhost:5000/api/convert . Tested it again at my end without problems.

  • I added Kestrel server profile to launchSettings.json:

    "Kestrel": {
      "commandName": "Project",
      "launchUrl": "pdf",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "applicationUrl": "http://localhost:5000"
    }

Select Kestrel profile in VS: image In browser go to route http://localhost:5000/pdf. Now you should get expected result. The reason that I added Kestrel profile is because this library is not compatible with IIS. Problem with IIS is how IIS manage app pools. To resolve that issue Remoting tools should be used but they are not supported in .NET Core.

You see changes that i made to your project here.

0reactions
bmikkelsen22commented, Jul 31, 2017

Thanks for the quick response! It’s working on my machine as well with Kestrel.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix Unable to Load DLL/Error ...
About the Unable to Load DLL Error · Method 1: Reinstall the Program · Method 2: Disable the Auto-Startup of the Program ·...
Read more >
Methods to Fix Error in Loading DLL at Startup
Error in loading DLL occurs when a program calls upon a DLL file to perform a certain task, and the specified DLL cannot...
Read more >
Unable to access the DLL file
The solution is almost always to reinstall the program. It likely has a .dll library onboard and needs to replace the file. Reinstalling...
Read more >
Failed to load DLL file on Windows 11/10 computer
Failed to load DLL file on Windows · 1] Reinstall the program · 2] Check startup programs · 3] Run Registry Cleaner ·...
Read more >
4 Methods on How To Open DLL Files (With Example ...
Open the command prompt. You can open the command prompt by going to the Windows Start menu or by holding Windows Key+R and...
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