SetLogEvent Not Found: Fix for IronPDF

This article was translated from English: Does it need improvement?
Translated
View the article in English
No function was found with the name SetLogEvent with error code (127)

錯誤訊息中提到的 SetLogEvent 是指 IronPDF 庫中一個無法執行的方法,導致了此異常。

可能原因

此異常通常發生在用戶在專案中升級 IronPdf.Slim 的版本而未更新其依賴包時,尤其是 IronPdf.Native.Chrome.WindowsIronPdf.Native.Chrome.Linux(針對基於 Linux 的系統)。 此版本不匹配可能會導致兼容性問題,從而導致上述運行時錯誤訊息。

解決方案

為了避免此問題,建議在 NuGet 套件管理器中卸載舊版本的 IronPDF 然後再安裝新版本。 這確保了所有以前的套件殘餘被清除,防止潛在的衝突。 此外,這種方法將自動更新所有依賴包至與新 IronPDF 版本兼容的版本。

或者,如果您僅使用 IronPdf.Slim 套件,您可以在專案中包含以下代碼:

// Enabling automatic download of compatible native binaries for IronPDF
IronPdf.Installation.AutomaticallyDownloadNativeBinaries = true;
// Enabling automatic download of compatible native binaries for IronPDF
IronPdf.Installation.AutomaticallyDownloadNativeBinaries = true;
' Enabling automatic download of compatible native binaries for IronPDF
IronPdf.Installation.AutomaticallyDownloadNativeBinaries = True
$vbLabelText   $csharpLabel

此代碼將在您的專案首次運行時自動下載與依賴包兼容的版本。 一旦下載完成,除非會話重啟或完全重置,否則不需要再次下載。

For more information on compatible versions of IronPDF dependencies, refer to the NuGet pages for IronPdf and IronPdf.Slim.

如果您需要進一步的協助,請提交一個 工程請求

Curtis Chau
技術作家

Curtis Chau 擁有卡爾頓大學計算機科學學士學位,專注於前端開發,擅長於 Node.js、TypeScript、JavaScript 和 React。Curtis 熱衷於創建直觀且美觀的用戶界面,喜歡使用現代框架並打造結構良好、視覺吸引人的手冊。

除了開發之外,Curtis 對物聯網 (IoT) 有著濃厚的興趣,探索將硬體和軟體結合的創新方式。在閒暇時間,他喜愛遊戲並構建 Discord 機器人,結合科技與創意的樂趣。

準備好開始了嗎?
Nuget 下載 16,154,058 | 版本: 2025.11 剛剛發布