解決 PDFium 依賴性錯誤

This article was translated from English: Does it need improvement?
Translated
View the article in English

Google PDFium 是 IronPDF 核心程式碼的重要組成部分,用於執行各種與 PDF 編輯以及將 PDF 文件轉換為圖像相關的功能。 若專案資料夾中缺少 PDFium 二進位檔,執行時將拋出以下錯誤。

Unhandled exception. IronSoftware.Exceptions.IronSoftwareDeploymentException: Error while deploying Pdfium for IronPdf: 'Unable to locate 'IronPdfInterop'

通常將 IronPdf.Native.PdfModel 套件安裝至專案中即可解決此問題。

在 Windows 系統上,建議確認目標作業系統已安裝 Visual C++ 執行階段套件

若上述方法仍無法解決問題,該如何處理?

若問題仍未解決,我們隨時提供協助。相容性是我們工程團隊的首要考量。 請透過電子郵件提交錯誤報告至 support@ironsoftware.com./support@ironsoftware.com 所有相容性問題都將由資深工程師進行嚴格審查。

請務必告知我們部署的作業系統/平台,尤其是若為 AWS 或 Azure 等雲端平台時。

如何在 IronPDF 中啟用原生記錄功能

若在錯誤回報中附上日誌檔案,將使我們能鎖定問題並迅速解決的機率提高一倍以上。

請將此程式碼置於程式頂端,並在執行任何 IronPDF 方法之前加入(適用於 2021.3.1 之後的所有版本)。

// Enable debugging to generate detailed log files for troubleshooting.
IronPdf.Logging.Logger.EnableDebugging = true;

// Set the path for the log file. You can specify a directory name or a full file path.
IronPdf.Logging.Logger.LogFilePath = "Default.log";

// Set the logging mode to log all events.
IronPdf.Logging.Logger.LoggingMode = IronPdf.Logging.Logger.LoggingModes.All;
// Enable debugging to generate detailed log files for troubleshooting.
IronPdf.Logging.Logger.EnableDebugging = true;

// Set the path for the log file. You can specify a directory name or a full file path.
IronPdf.Logging.Logger.LogFilePath = "Default.log";

// Set the logging mode to log all events.
IronPdf.Logging.Logger.LoggingMode = IronPdf.Logging.Logger.LoggingModes.All;
' Enable debugging to generate detailed log files for troubleshooting.
IronPdf.Logging.Logger.EnableDebugging = True

' Set the path for the log file. You can specify a directory name or a full file path.
IronPdf.Logging.Logger.LogFilePath = "Default.log"

' Set the logging mode to log all events.
IronPdf.Logging.Logger.LoggingMode = IronPdf.Logging.Logger.LoggingModes.All
$vbLabelText   $csharpLabel

由 IronPDF 建立的日誌檔案位於您專案中部署 DLL 的 /bin 目錄內:

  • default.log (部署流程)
  • cef.log (渲染)
  • IronSoftwareCefSubprocess.log (渲染與執行緒)
  • IronSoftwareEngine.log(適用於除錯以"Error generating PDF from..."開頭的例外狀況)

雲端伺服器通常會將日誌檔案儲存於特定位置。 我們提供在 AzureAWS 中建立日誌檔案的指南。

Curtis Chau
技術撰稿人

Curtis Chau 擁有卡爾頓大學(Carleton University)的電腦科學學士學位,專精於前端開發,並精通 Node.js、TypeScript、JavaScript 及 React。他熱衷於打造直觀且美觀的用戶介面,喜歡運用現代框架,並創建結構完善、視覺上吸引人的手冊。

除了開發工作之外,Curtis 對物聯網(IoT)抱有濃厚興趣,致力於探索整合硬體與軟體的創新方法。閒暇時,他喜歡玩遊戲和開發 Discord 機器人,將對科技的熱愛與創意相結合。

準備開始了嗎?
Nuget 下載 19,014,616 | 版本: 2026.5 just released
Still Scrolling Icon

還在往下捲動嗎?

想要快速確認成果嗎? PM > Install-Package IronPdf
執行範例 觀看您的 HTML 轉為 PDF。