IronPDF 中 Chrome 依賴項的疑難排解
Google Chromium HTML 渲染器是 IronPDF"HTML 轉 PDF"渲染流程中不可或缺的一部分。 此渲染器的核心二進位檔應可於 IronPDF NuGet 套件中輕鬆找到。 若專案資料夾中缺少此二進位檔,將會拋出以下錯誤:
Unhandled exception. IronSoftware.Exceptions.IronSoftwareDeploymentException: Error while deploying IronPdf Chrome renderer: 'Unable to locate 'IronInterop'.
若 IronPDF 無法自動部署 Chrome 依賴項,可能需要透過 NuGet 手動將其新增至專案中。 可新增多項依賴項:
在 Windows 系統上,建議確認目標作業系統已安裝 Visual C++ 執行階段套件。 許多現代應用程式若缺少這個關鍵的作業系統元件,便無法運行。
Linux
- 請確保使用正確的 Docker 檔案。
- 請使用 IronPdf.Linux NuGet 套件,而非 IronPDF。
-
將 Chrome 渲染的 GPU 模式設為停用:
IronPdf.Installation.ChromeGpuMode = IronPdf.Engines.Chrome.ChromeGpuModes.Disabled;IronPdf.Installation.ChromeGpuMode = IronPdf.Engines.Chrome.ChromeGpuModes.Disabled;IronPdf.Installation.ChromeGpuMode = IronPdf.Engines.Chrome.ChromeGpuModes.Disabled$vbLabelText $csharpLabel -
停用 Linux 和 Docker 依賴項的自動配置:
csharp Installation.LinuxAndDockerDependenciesAutoConfig = false;csharp Installation.LinuxAndDockerDependenciesAutoConfig = false;csharp Installation.LinuxAndDockerDependenciesAutoConfig = False$vbLabelText $csharpLabel
macOS
- 請確認 .NET 執行環境已設定為正確的架構 - x64 或 arm64。
若上述方法仍無法解決問題,該如何處理?
若問題仍未解決,我們隨時提供協助。相容性是我們工程團隊的首要考量。 請透過電子郵件提交錯誤報告至 support@ironsoftware.com./support@ironsoftware.com 所有相容性問題都將由資深工程師進行嚴格審查。
請務必告知我們部署的作業系統/平台,尤其是若為 AWS 或 Azure 等雲端平台時。
如何在 IronPDF 中啟用原生記錄功能
若在錯誤回報中附上日誌檔案,我們能成功定位問題並迅速解決的機率將提高一倍以上。
請在執行任何 IronPDF 方法之前,將此程式碼置於您的程式碼頂端(適用於 2021.3.1 之後的所有版本):
// Set the log file path, this can be a directory or a full file path
IronPdf.Logging.Logger.LogFilePath = "Default.log";
// Enable all logging modes for detailed logging information
IronPdf.Logging.Logger.LoggingMode = IronPdf.Logging.Logger.LoggingModes.All;
// Set the log file path, this can be a directory or a full file path
IronPdf.Logging.Logger.LogFilePath = "Default.log";
// Enable all logging modes for detailed logging information
IronPdf.Logging.Logger.LoggingMode = IronPdf.Logging.Logger.LoggingModes.All;
' Set the log file path, this can be a directory or a full file path
IronPdf.Logging.Logger.LogFilePath = "Default.log"
' Enable all logging modes for detailed logging information
IronPdf.Logging.Logger.LoggingMode = IronPdf.Logging.Logger.LoggingModes.All
由 IronPDF 建立的日誌檔案位於您的專案中部署 DLL 的 /bin 目錄下:
- default.log (部署流程)
- cef.log (渲染)
- IronSoftwareCefSubprocess.log (渲染與執行緒)
- IronSoftwareEngine.log(用於除錯以"Error generating PDF from..."開頭的例外狀況)

