Unable to load DLL 'libwkhtmltox' or one of its dependencies
See original GitHub issueRequest ID: System.AggregateException: One or more errors occurred. (Unable to load DLL ‘libwkhtmltox’ or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E)) —> System.DllNotFoundException: Unable to load DLL ‘libwkhtmltox’ or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at DinkToPdf.WkHtmlToXBindings.wkhtmltopdf_init(Int32 useGraphics)
at DinkToPdf.PdfTools.Load()
at DinkToPdf.BasicConverter.Convert(IDocument document)
at DinkToPdf.SynchronizedConverter.<>n__0(IDocument document)
at DinkToPdf.SynchronizedConverter.<>c__DisplayClass5_0.<Convert>b__0()
at System.Threading.Tasks.Task1.InnerInvoke() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location where exception was thrown --- at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) --- End of inner exception stack trace --- at DinkToPdf.SynchronizedConverter.Invoke[TResult](Func
1 delegate)
at DinkToPdf.SynchronizedConverter.Convert(IDocument document)
at GymCore.Controllers.RegistrationController.CreatePDF(Int32 regno) in C:\Users\UDN002\Desktop\GymCore\GymCore\Controllers\RegistrationController.cs:line 489
at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at System.Threading.Tasks.ValueTask1.get_Result() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync() at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.Invoke(HttpContext context) ---> (Inner Exception #0) System.DllNotFoundException: Unable to load DLL 'libwkhtmltox' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E) at DinkToPdf.WkHtmlToXBindings.wkhtmltopdf_init(Int32 useGraphics) at DinkToPdf.PdfTools.Load() at DinkToPdf.BasicConverter.Convert(IDocument document) at DinkToPdf.SynchronizedConverter.<>n__0(IDocument document) at DinkToPdf.SynchronizedConverter.<>c__DisplayClass5_0.<Convert>b__0() at System.Threading.Tasks.Task
1.InnerInvoke()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
— End of stack trace from previous location where exception was thrown —
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)<—
Still facing the issue can you please help :
I have set the properties of libwkhtmltox.dll
I tried the both the both debug & release.
I’m stuck please help
Issue Analytics
- State:
- Created 5 years ago
- Comments:17
Top GitHub Comments
I solved this problem more quickly.
Solution: Add these codes inside the Project.Service.csproj
What you might be experiencing could be a misleading error message, if you don’t have the VSRedist 2015 package installed on the machine/server. (typical for use of c++ libraries)
You could try using my powershell module to detect/silently install the redistributable package: PowershellVsRedistInstaller
You can also just check the powershell code to find where to check in the registry or check where to download the files.