HakanL / WkHtmlToPdf-DotNet

C# .NET Core wrapper for wkhtmltopdf library that uses Webkit engine to convert HTML pages to PDF.
GNU Lesser General Public License v3.0
367 stars 66 forks source link

Errors in Windows Based Azure Function #74

Closed leijae closed 2 years ago

leijae commented 2 years ago

On v1.5.68 using .NET Core 3.1 VS 2022

I've deployed this on a v3 azure function with a windows environment. When I generate a pdf locally, no issues, but in the azure function environment it produced a PDF like the photo below

image

I assumed it was because the DLL's weren't doing their jobs, so I set their properties to "Content" and "Copy Always"

Now, when I try to publish my functions I get the following error in VS 2022 output window with a failed deployment: Could not evaluate 'wkhtmltox.dll' for extension metadata. Exception message: Format of the executable (.exe) or library (.dll) is invalid. 5>Found multiple publish output files with the same relative path: C:\Users\leija\.nuget\packages\haukcode.wkhtmltopdfdotnet\1.5.68\runtimes\win-x64\native\wkhtmltox.dll, C:\Users\leija\.nuget\packages\haukcode.wkhtmltopdfdotnet\1.5.68\runtimes\win-x86\native\wkhtmltox.dll. ========== Build: 4 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== ========== Publish: 0 succeeded, 1 failed, 0 skipped ==========

Has anyone seen this issue and have a fix for it?

leijae commented 2 years ago

Ok it looks like this is the solution to my issue.

image