问题
Local PDF generation works well, but the same application stoped working on server. Event log says:
Faulting application wkhtmltopdf.exe, version 0.12.2.1, time stamp 0x54bd0265, faulting module MSVCP120.dll, version 6.0.6002.18881, time stamp 0x51da3e00, exception code 0xc0000135, fault offset 0x0006f52f, process id 0x44b8, application start time 0x01d07ce4c087128f.
and
Exception information: Exception type: IOException Exception message: The pipe has been ended.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count)
at NReco.PdfGenerator.HtmlToPdfConverter.GeneratePdfInternal(String htmlFilePath, Byte[] inputBytes, String coverHtml, String outputPdfFilePath, Stream outputStream)
回答1:
I've spent 4 hours wrestling with this today, so I thought i'd post my solution to help anyone else suffering in thr future.
wkhtmltopdf was updated and worked on my local machine. Pushed the code to the server and nothing.
I eventually tracked this down to needing to install the 32 bit version of C++Runtime from here https://www.microsoft.com/en-GB/download/details.aspx?id=40784
In my case, due to some 3rd party libraries I cannot remove yet, I was forced to run the website in 32 bit mode. As my server is 64 bit, the 32 bit versions were not present. (As my PC is a Dev Machine, I assume that I got all the relevent libraries from MS, hence why I had no local issue.)
回答2:
Solution is to check accesibility of dll's msvcp120.dll and msvcr120.dll. Local copy of libraries into app bin dir solve my problem.
来源:https://stackoverflow.com/questions/29795885/nreco-pdfgenerator-in-asp-net-stopped-working-on-server