CodeMazeBlog/create-pdf-with-netcore

Unable to load shared library

Opened this issue · 0 comments

I run this sample on Window is OK but on Linux (CenOs7) it do not work
I get these error:
[root@localhost PDF_Generator]# dotnet run
Unhandled Exception: System.DllNotFoundException: Unable to load shared library '/root/Desktop/git/create-pdf-with-netcore/PDF_Generator/PDF_Generator/libwkhtmltox.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: /root/Desktop/git/create-pdf-with-netcore/PDF_Generator/PDF_Generator/libwkhtmltox.dll: invalid ELF header
at System.Runtime.Loader.AssemblyLoadContext.InternalLoadUnmanagedDllFromPath(String unmanagedDllPath)
at System.Runtime.Loader.AssemblyLoadContext.LoadUnmanagedDllFromPath(String unmanagedDllPath)
at PDF_Generator.Utility.CustomAssemblyLoadContext.LoadUnmanagedDll(String unmanagedDllName) in /root/Desktop/git/create-pdf-with-netcore/PDF_Generator/PDF_Generator/Utility/CustomAssemblyLoadContext.cs:line 18
at PDF_Generator.Utility.CustomAssemblyLoadContext.LoadUnmanagedLibrary(String absolutePath) in /root/Desktop/git/create-pdf-with-netcore/PDF_Generator/PDF_Generator/Utility/CustomAssemblyLoadContext.cs:line 14
at PDF_Generator.Startup.ConfigureServices(IServiceCollection services) in /root/Desktop/git/create-pdf-with-netcore/PDF_Generator/PDF_Generator/Startup.cs:line 35
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
at Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize()
at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
at PDF_Generator.Program.Main(String[] args) in /root/Desktop/git/create-pdf-with-netcore/PDF_Generator/PDF_Generator/Program.cs:line 17

Please help