ClickOnce 發佈錯誤

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,而非發布檔案中封裝的 DLL。針對此問題有兩種解決方法。

解決方案 1

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

解決方案 2

若您電腦上的 IronPDF 安裝程式未被使用,請將其解除安裝,以避免版本不符的問題。

有關如何安裝及建立 ClickOnce 專案的詳細資訊,請參閱此處的 Microsoft 官方文件。

Curtis Chau
技術撰稿人

Curtis Chau 擁有卡爾頓大學(Carleton University)的電腦科學學士學位,專精於前端開發,並精通 Node.js、TypeScript、JavaScript 及 React。他熱衷於打造直觀且美觀的用戶介面,喜歡運用現代框架,並創建結構完善、視覺上吸引人的手冊。

除了開發工作之外,Curtis 對物聯網(IoT)抱有濃厚興趣,致力於探索整合硬體與軟體的創新方法。閒暇時,他喜歡玩遊戲和開發 Discord 機器人,將對科技的熱愛與創意相結合。

準備開始了嗎?
Nuget 下載 18,918,602 | 版本: 2026.5 just released
Still Scrolling Icon

還在往下捲動嗎?

想要快速確認成果嗎? PM > Install-Package IronPdf
執行範例 觀看您的 HTML 轉為 PDF。