如何让 Wix 安装程序使用 bindingRedirects 更新 app.config

发布于 2024-09-14 06:15:48 字数 683 浏览 1 评论 0原文

我有一个 Wix 3.0 项目,它将一些 .Net 程序集安装到现有应用程序中。作为安装的一部分,我需要使用 bindingRedirects 更新应用程序的配置文件,以便使用正确的程序集版本,例如

<configuration>
<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
            <assemblyIdentity name="MyAssembly" publicKeyToken="deadbeefdeadbeef" culture="neutral" />
            <bindingRedirect oldVersion="1.0.0.0-1.0.10.0" newVersion="1.0.10.0"/>
        </dependentAssembly>
    </assemblyBinding>
</runtime>

这会将绑定重定向到最高 1.0.10.0 的 MyAssembly 版本,以便它们转到已安装的版本 1.0.10.0。安装的版本号 (newVersion) 随着时间的推移而变化,因此必须在安装时确定。

干杯。

I have a Wix 3.0 project that installs some .Net assemblies into an existing application. As part of the installation, I need to update the application's config file with bindingRedirects so that the correct assembly versions are used, e.g.,

<configuration>
<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
            <assemblyIdentity name="MyAssembly" publicKeyToken="deadbeefdeadbeef" culture="neutral" />
            <bindingRedirect oldVersion="1.0.0.0-1.0.10.0" newVersion="1.0.10.0"/>
        </dependentAssembly>
    </assemblyBinding>
</runtime>

This will redirect bindings to MyAssembly versions up to 1.0.10.0 so that they go to the installed version 1.0.10.0. The installed version number (newVersion) changes over time, and so has to be determined at install time.

Cheers.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

七度光 2024-09-21 06:15:48

您可以使用 XmlFile 元素在 WiX 安装期间更新 XML 文件。

但是,请务必将配置文件包含在与 exe 文件相同的组件中(作为 伴随文件);否则,升级过程中可能会出现问题。

You can use the XmlFile element to update an XML file during a WiX install.

However, be sure to include the config file in the same component as the exe file (as a companion file); otherwise, there may be problems during upgrading.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文