2013-05-01 152 views
0

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

为了解决这个我包括

<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 。我该如何解决这个问题?

回答

0

而不是增加一个重复的部分,做一个binding redirect

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

我试过这个不知道为什么它没有工作 – nzdev 2013-05-07 05:20:32