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

[{i:(要找到此版本,请运行该程序,打开 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 对物联网 (IoT) 有浓厚的兴趣,探索将硬件和软件集成的新方法。在空闲时间,他喜欢玩游戏和构建 Discord 机器人,将他对技术的热爱与创造力相结合。

准备开始了吗?
Nuget 下载 16,133,208 | 版本: 2025.11 刚刚发布