Version Mismatch Exception

This article was translated from English: Does it need improvement?
Translated
View the article in English
Invalid assembly version for 'IronInterop' (actual: 2022.x.x.xxxx; expected: 2022.x.x.xxxx). This version of IronPdf requires updated native dependencies. Please clear your build output directory of old assemblies so IronPdf can automatically download the new dependencies at runtime. Alternatively, you may add NuGet package IronPdf.Native.Chrome version 2022.x.xxxx to your project and rebuild.

當 IronPdf.Slim 套件及其依賴項目因版本不匹配而不兼容時,會發生此錯誤。

可能原因

錯誤通常發生在僅更新 IronPdf.Slim 套件,而其依賴項目仍然過時的情況下。

IronPdf.Slim 套件的主要依賴項目包括:

這些依賴項目可能不會自動隨 IronPdf.Slim 更新,特別是在較舊的版本中。

解決方案

要解決此問題,請考慮以下選項:

  • 重新安裝 IronPDF 套件:在 Visual Studio 中使用 NuGet 套件管理器卸載所有與 IronPDF 相關的套件,然後重新安裝最新版本。 這可確保移除舊二進制文件,防止運行時衝突。 請參考 NuGet 頁面 以獲取兼容的依賴版本。

  • 切換至 IronPdf:卸載 IronPdf.Slim 及其依賴項目,然後安裝完整的 IronPdf 套件。 這會自動包含所有必要的依賴項目及兼容的版本。

  • 啟用自動下載依賴項目:卸載所提到的依賴項目,並使用以下代碼與 IronPdf.Slim 一起使用:

    // Enables automatic download of native binaries during runtime
    IronPdf.Installation.AutomaticallyDownloadNativeBinaries = true;
    // Enables automatic download of native binaries during runtime
    IronPdf.Installation.AutomaticallyDownloadNativeBinaries = true;
    ' Enables automatic download of native binaries during runtime
    IronPdf.Installation.AutomaticallyDownloadNativeBinaries = True
    $vbLabelText   $csharpLabel

    這將在初次運行時下載正確的本機二進制文件和依賴項目。 請注意,這需要網絡連接並可能需要一些時間。

如需要進一步幫助,請提交 工程請求

Curtis Chau
技術作家

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

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

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