ClickOnce Publish Error

This article was translated from English: Does it need improvement?
Translated
View the article in English

當您嘗試運行使用 IronPDF 的已發佈 ClickOnce 專案時,您可能會遇到以下執行時錯誤。

ERROR: Error while deploying IronPdf Chrome renderer: 'Multiple issues occurred while trying to deploy Chrome (Failed to locate 'IronInterop' at 'C:\iron testing\NETPublish(ClickOnce)\IronPdfZipClickOnce\bin\Debug\net8.0-windows\') (Failed to locate 'IronInterop' at 'C:\iron testing\NETPublish(ClickOnce)\IronPdfZipClickOnce\bin\Debug\net8.0-windows') (Invalid assembly version for 'IronInterop' (actual: 2025.2.0.15; expected: 2025.4.0.16). 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.Windows version 2025.4.16 to your project and rebuild.)[Issue Code IRONPDF-CHROME-DEPLOYMENT-ERROR-WIN].To learn more about making an engineering support request please visit: <a href=https://ironpdf.com/troubleshooting/engineering-request-pdf/>. To learn how to solve this issue please read https://ironpdf.com/troubleshooting/error-while-deploying-chrome-dependencies/ [Issue Code IRONPDF-CHROME-DEPLOYMENT-ERROR-WIN]

此錯誤可能是由於專案正在使用本地 IronPDF 安裝中的 IronPdfInterop.dll,而非與可執行文件一起打包的版本。如果您檢查正在運行的應用程式所使用的 DLL 版本,您會看到其版本是 2025.2.0.15 而非所需的發布版本 2025.4.0.4

請注意要找到此版本,請運行程式,打開 Windows 資源管理器,單擊 CPU 標籤以選擇正在運行的進程。

版本差異

您可能已注意到 IronPdfInterop.dll 的路徑是 IronPDF 安裝的預設路徑。

解決方案

核心問題在於專案引用了本地 IronPDF 安裝中的 DLL,而非已發佈文件中打包的版本。這有兩個解決方法。

解決方案 1

請更新現有的 IronPDF 安裝以匹配所需版本 2025.4.4。如果成功,Windows 資源管理器中顯示的 IronPdfInterop.dll 版本應為 2025.4.0.4,而非過時的版本。

解決方案 2

如果您機器上的 IronPDF 安裝沒有在使用,請卸載它以避免版本不匹配。

有關如何安裝和創建 ClickOnce 專案的更多資訊,請參考微軟的官方文件 此處

Curtis Chau
技術作家

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

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

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