开发者

configure assemblyBinding once for multiple executables

I have a folder that contains multiple executables. Currently the assembly binding redirect is configured in each executable.exe.config file. Is there a way to configure this just once and all executables in that folder pick this up automatically? I'd like to avoid machine.config because this will apply it for the whole computer.

<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>


It is possible to "split" your configs in different sections and place those sections to external files. You would an almoust empty config for every exe and add there such a section. However the Enterprise Lib offers an application block for this.
Another solution is to use symbolic file links - aka junction - to redirect every single config to the global one (but I do not recommend doing this).


I believe there's no way to have one config file for multiple executables. MSDN mentions only two options - executable.exe.config and global machine.config.

The only solution that came to my mind is to create one big executable that has all current executables functionality (and one common configuration) and then make your current executables run the big one with some kind of switch etc.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜