在 Azure Web 应用程序中使用 wkhtmltopdf 时出现 CGI 错误

CGI error using wkhtmltopdf in Azure web app

在我的 ASP.Net 核心网络应用程序中,我使用的是 DinkToPdf,它是 wkhtmltopdf 库的 C# 包装器。

我的应用程序部署为 Azure Web 服务(标准计划)。

在本地,我可以毫无问题地生成 pdf。但是几天来,我在尝试生成 pdf 时在 Azure 上遇到以下错误:

The specified CGI application encountered an error and the server terminated the process.

Azure 尚未完全支持 wkhtmltopdf 库 (https://github.com/projectkudu/kudu/wiki/Azure-Web-App-sandbox#unsupported-frameworks) - 但无论如何,它已经工作了数周。

我没有对我的项目做任何小的改动。 也许有人有想法?

我发现了问题: html 模板中使用的 url 错误(指向本地主机)并导致 CGI 错误。