IronPDF 中的原生异常处理。
This article was translated from English: Does it need improvement?
TranslatedView 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 Embedded Framework过程的日志。
请注意在旧版本的 IronPdf 中,日志文件可能还包括
IronSoftwareEngine.log. 请提交请求工程支持时生成的所有日志文件。准备开始了吗?
Nuget 下载 16,685,821 | 版本: 2025.12 刚刚发布






