C# – System.DllNotFoundException: ‘Unable to load DLL ‘libwkhtmltox’: The specified module could not be found. (Exception from HRESULT: 0x8007007E)’

apiasp.net-corecpdf-generation

Getting error when trying to generate PDF from HTML template. I have a different class library for generating PDF and I'm calling that from another controller.

System.DllNotFoundException: 'Unable to load DLL 'libwkhtmltox': The
specified module could not be found. (Exception from HRESULT:
0x8007007E)'

Best Answer

your csproj file to enforce copying NuGet assemblies to the built output:

<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>