为多个可执行文件配置汇编一次
-
10-10-2019 - |
题
我有一个包含多个可执行文件的文件夹。当前,组件绑定重定向在每个中配置 executable.exe.config
文件。有没有办法将其仅一次和该文件夹中的所有可执行文件进行配置?我想避免使用Machine.config,因为这将应用于整个计算机。
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<publisherPolicy apply="yes" />
<dependentAssembly>
<assemblyIdentity name="SomeAssembly" publicKeyToken="10addddbec4aebba" />
<publisherPolicy apply="yes" />
<bindingRedirect oldVersion="0.0.0.0-7.9.999.0" newVersion="5.8.11.5" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="SomeOtherAssembly" publicKeyToken="23adeddbac4ae12a" />
<publisherPolicy apply="yes" />
<bindingRedirect oldVersion="0.0.0.0-7.9.999.0" newVersion="5.8.11.5" />
</dependentAssembly>
</assemblyBinding>
其他提示
我相信无法为多个可执行文件提供一个配置文件。 MSDN 仅提及两个选项 - executable.exe.config
和全球 machine.config
.
我想到的唯一解决方案是创建一个具有所有当前可执行文件功能(和一个常见配置)的大型可执行文件,然后使您当前的可执行文件使用某种开关等。
不隶属于 StackOverflow