如何让 Wix 安装程序使用 bindingRedirects 更新 app.config
我有一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 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.