IronPDF的原生例外處理
This article was translated from English: Does it need improvement?
Translated
View the article in English
在IronPDF的最新版本中,日誌中的原生例外訊息將包含特定問題程式碼:[Issue Code IronPDF-NATIVE-EXCEPTION]。 以下顯示了這類例外訊息的範例:
IronPdf.Exceptions.IronPdfNativeException: Error while generating PDF from HTML: 'Error while rendering pdf from html for job group 0: 'Error during dev tools execution: {"method":"Inspector.targetCrashed","params":{}}''.
2024-01-25 08:12:11,960 INFO [Thread-3] [, , , , , , , , ] c.i.i.i.s.Access: [IronPdfEngine] To learn how to solve this issue please read https://ironpdf.com/troubleshooting/ironpdf-native-exception [Issue Code IRONPDF-NATIVE-EXCEPTION]
可能原因
IronPDF的原生例外通常由IronPdf.Native.Chrome套件中的C++程式碼相關的各種問題引起,該套件是IronPDF的相依性,並涉及使用Chrome PDF呈現引擎。
解決方案
如需相關原生例外問題的協助,請提交工程支援請求,並提供完整的日誌檔案以進一步調查。
透過在您的專案中包含以下程式碼片段來啟用原生日誌紀錄:
// Set the path for the log file.
// This can be a directory name or a specific file path. Here, we set it to "Default.log".
IronPdf.Logging.Logger.LogFilePath = "Default.log";
// Enable logging for all modes to capture comprehensive details
IronPdf.Logging.Logger.LoggingMode = IronPdf.Logging.Logger.LoggingModes.All;
// Set the path for the log file.
// This can be a directory name or a specific file path. Here, we set it to "Default.log".
IronPdf.Logging.Logger.LogFilePath = "Default.log";
// Enable logging for all modes to capture comprehensive details
IronPdf.Logging.Logger.LoggingMode = IronPdf.Logging.Logger.LoggingModes.All;
' Set the path for the log file.
' This can be a directory name or a specific file path. Here, we set it to "Default.log".
IronPdf.Logging.Logger.LogFilePath = "Default.log"
' Enable logging for all modes to capture comprehensive details
IronPdf.Logging.Logger.LoggingMode = IronPdf.Logging.Logger.LoggingModes.All
$vbLabelText
$csharpLabel
IronPDF建立的日誌檔案通常位於您的DLL已部署的專案/bin目錄中,或您可以設定自定義的IronPdf.Logging.Logger.LogFilePath來將日誌檔案儲存在特定位置。 相關的日誌檔案包括:
- Default.log:包含有關部署、執行緒及呈現過程的資訊。 這對觀察過程行為及例外情況很有用。
- cef.log:包含Chrome嵌入框架的過程日誌。
請注意在舊版本的IronPDF中,日誌檔案可能還包含
IronSoftwareEngine.log。 請提交請求工程支援時生成的所有日誌檔案。準備開始了嗎?
Nuget 下載 19,936,792 | 版本: 2026.7 剛剛發布

