ClickOnce 发布错误
当您尝试运行使用 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。

您可能已经注意到 IronPDFInterop.dll 的路径是来自 IronPDF 安装的默认路径。
解决方案
核心问题是项目引用了本地 IronPDF 安装中的 DLL,而不是已发布文件中封装的版本。有两个解决方案。
解决方案 1
请将现有的 IronPDF 安装更新至所需版本 2025.4.4。若更新成功,Windows 资源管理器中显示的 IronPdfInterop.dll 版本应为 2025.4.0.4,而非过时的版本。
解决方案 2
如果您计算机上的 IronPDF 安装未使用,请卸载它以避免版本不匹配。
有关如何安装和创建 ClickOnce 项目的更多信息,请参阅此处的微软官方文档。

