pugpdf icon indicating copy to clipboard operation
pugpdf copied to clipboard

wrong destination path, not running with azure-function,

Open AndyG74 opened this issue 4 years ago • 4 comments

the wkhtmltopdf binaries will be copyed in a wrong folder.

DestinationFiles="$(OutDir)\wkhtmltopdf<plattform><bitness>\wkhtmltopdf" is not ok for AzureFunction.

it must be: DestinationFiles="$(OutDir)\bin\wkhtmltopdf<plattform><bitness>\wkhtmltopdf"

the start of any azurefunction is "../bin/court4u.AzureFunction.dll" image

but the binaries not copyed in the correct bin-folder image

do you can fix this? or do you have any workaround?

AndyG74 avatar Apr 22 '20 20:04 AndyG74

我也遇到了这个问题,并且我解决了这个问题。 (I had this problem, and I solved it)

我猜测你和我一样,有多个“解决方案”。 (My guess is that you, like me, have multiple "solutions.")

如图所示: (as shown in the figure) image

这样子就可以解决 (That's how it works) image

总结: (summarize)

在所有你使用到的“解决方案”中,都安装【PugPDF.Core】包,就可以完美解决此问题。 (Install the [PugPDF.Core] package in all the "solutions" you use to solve this problem.)

2020.04.23 13:14

ping9719 avatar Apr 23 '20 05:04 ping9719

@AndyG74 Did it work by adding the nuget to the host project?

If not maybe you can try to change the output dir for the project. <OutputPath>somedir</OutputPath>

I know that there are some project that will output to /bin and some are not, but not sure how to determine which it is in the .target file

pug-pelle-p avatar Apr 29 '20 15:04 pug-pelle-p

hi, no that is not a solution for AzureFunctions. i have try to copy the wkhtmltopdf-folder by post-build event, but also this is not a solution.

a valid solution is:

  • deploy the azurefunction with the visual studio to azure-cloud
  • then copy the wkhtmltopdf-folder to the correct azurefunction-bin-folder

AndyG74 avatar Apr 29 '20 17:04 AndyG74

I'm thinking of removing the publish step (that moves the binaries to the publish folder) and instead unpacking the binaries in runtime by writing it to a temp folder. Would that work for azure functions? Does it have write access?

pug-pelle-p avatar Jun 09 '20 15:06 pug-pelle-p