版本不匹配異常

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;
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

首次運行時,這將下載正確的本機二進位和相依性。 請注意,這需要連接互聯網,並且可能需要一些時間。

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

Curtis Chau
技術作家

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

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

準備好開始了嗎?
Nuget 下載 16,685,821 | 版本: 2025.12 剛發表