gpt4 book ai didi

azure - 部署到 Azure 网站时可能导致 EvoPDF "unable to render html"异常的原因

转载 作者:行者123 更新时间:2023-12-02 06:33:21 24 4
gpt4 key购买 nike

将 EvoPDF 用于 .Net Web 应用程序可以在本地运行,但是一旦部署到 Microsoft Azure 网站,它就会抛出一般异常:“无法呈现 html”。

堆栈跟踪:

[Exception: Could not render the HTML string.]
EvoPdf.HtmlToImageConverter.ᜀ(String A_0, String A_1, String A_2, ᜴& A_3, Hashtable& A_4) +2129
EvoPdf.HtmlToPdfConverter.ᜀ(String A_0, String A_1, String A_2, String A_3, Boolean A_4) +8369
EvoPdf.HtmlToPdfConverter.ᜀ(Stream A_0, String A_1, String A_2, String A_3, String A_4, Boolean A_5) +58
EvoPdf.HtmlToPdfConverter.ᜁ(String A_0, String A_1, String A_2, String A_3, Boolean A_4) +126
EvoPdf.HtmlToPdfConverter.ConvertHtml(String htmlString, String baseUrl, String internalLinksBaseUrl) +33
EvoPdf.HtmlToPdfConverter.ConvertHtml(String htmlString, String baseUrl) +12
td.Printing.Labels.Print.WithEvoPdf(HttpContext httpContext, Action`1 htmlPageRenderer, String outputFileName, Label labelFormat) in C:\...\Evo PDF Print Labels.vb:54
td.OL3016WR.Render(HtmlTextWriter writer) in C:\...\OL3016WR.aspx.vb:166
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +8921

最佳答案

您遇到了 Azure 应用服务沙箱运行时执行限制。

来自https://github.com/projectkudu/kudu/wiki/Azure-Web-App-sandbox#unsupported-frameworks :

Unsupported frameworks

Here is a list of frameworks and scenarios that have been found to be not be usable due to one or more of the restrictions above. It's conceivable that some will be supported in the future as the sandbox evolves.

PDF generators failing due to restriction mentioned above:

EVOPDF
Rotativa
wkhtmltopdf
Syncfusion
Siberix
NReco (uses wkhtmltopdf)
Spire.PDF

Other scenarios:
PhantomJS/Selenium: tries to connect to local address, and also uses GDI+.

正如您已经提到的,这在 Web/辅助角色(云服务)中工作得很好。Service Fabric 或 IaaS VM 是其他选项。

关于azure - 部署到 Azure 网站时可能导致 EvoPDF "unable to render html"异常的原因,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38558044/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com