首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为多个可执行文件配置一次assemblyBinding

为多个可执行文件配置一次assemblyBinding
EN

Stack Overflow用户
提问于 2010-12-08 18:24:57
回答 2查看 1.1K关注 0票数 0

我有一个包含多个可执行文件的文件夹。目前,程序集绑定重定向是在每个executable.exe.config文件中配置的。有没有办法只配置一次,然后该文件夹中的所有可执行文件都会自动拾取它?我希望避免使用machine.config,因为这将适用于整个计算机。

代码语言:javascript
复制
<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>
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2010-12-09 02:01:05

可以将您的配置“拆分”到不同的部分,并将这些部分放到外部文件中。您将为每个exe配置一个空配置,并在其中添加一个这样的部分。但是,Enterprise Lib为此提供了一个应用程序块。

另一种解决方案是使用符号文件链接-也就是junction -将每个单独的配置重定向到全局配置(但我不建议这样做)。

票数 1
EN

Stack Overflow用户

发布于 2010-12-09 01:40:21

我相信不可能有一个配置文件用于多个可执行文件。MSDN只提到了两个选项- executable.exe.config和全局machine.config

我想到的唯一解决方案是创建一个具有所有当前可执行文件功能(和一个通用配置)的大型可执行文件,然后通过某种切换使您当前的可执行文件运行大型可执行文件。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4386408

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档