【问题标题】:ESB Toolkit and Enterprise Library collisionESB 工具包和企业库冲突
【发布时间】:2013-04-26 00:05:39
【问题描述】:

您好,我需要使用企业库 5 来保持企业环境中的全面一致性。不幸的是,我们的机器上安装了 biz talk。企业库似乎与 ESB Toolkit 发生冲突。 ESB Toolkit 在 machine.config 中为 4.1 版的企业库创建一个部分。每次我运行我的应用程序时,它都会从 machine.config 中读取配置,并且应用程序会捕获异常。

为了解决这个问题,我加入了

<section name="enterpriseLibrary.ConfigurationSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.505.0,Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> 

在我的 web.config 文件中,但是当我运行它时,它说

There is a duplicate 'enterpriseLibrary.ConfigurationSource' section defined 

因为它仍然会去 machine.config 来读取 enterpriseLibrary.ConfigurationSource。我该如何解决这个问题?

【问题讨论】:

    标签: c# web-config enterprise-library esb-toolkit-2.0


    【解决方案1】:

    不要添加重复的部分,而是 binding redirect:

    <dependentAssembly>
          <assemblyIdentity name="Microsoft.Practices.EnterpriseLibrary.Common" publicKeyToken="31BF3856AD364E35"/>      
          <bindingRedirect oldVersion="4.1.0.0" newVersion="5.0.505.0" />
    </dependentAssembly>
    

    【讨论】:

      【解决方案2】:

      我已经解决了这个问题,我的答案在以下链接ESB Toolkit and Enterprise Library collision with IIS Web.Config

      我已采取的故障排除步骤可在以下 Microsoft 论坛上找到答案。 ESB Toolkit and Enterprise Library collision with IIS Web.Config

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2011-08-23
        • 2011-07-06
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-06-23
        相关资源
        最近更新 更多