问题
Hi i need to use enterprise library 5 to maintain consistency across the board in the enterprise environment. Unfortunately we have got biz talk installed in our machines. It seems that enterprise library collides with ESB Toolkit. ESB Toolkit creates a section in machine.config for enterprise library which is version 4.1. Every time i run my application it reads the config from machine.config and the application catches the exception.
To solve this i included
<section name="enterpriseLibrary.ConfigurationSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.505.0,Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
in my web.config file but when i run this it says
There is a duplicate 'enterpriseLibrary.ConfigurationSource' section defined
because its still going to machine.config to read the enterpriseLibrary.ConfigurationSource. How can i resolve this issue?
回答1:
Instead of adding a duplicate section, do a binding redirect:
<dependentAssembly>
<assemblyIdentity name="Microsoft.Practices.EnterpriseLibrary.Common" publicKeyToken="31BF3856AD364E35"/>
<bindingRedirect oldVersion="4.1.0.0" newVersion="5.0.505.0" />
</dependentAssembly>
回答2:
I have solved this issue and my answer is at the following link ESB Toolkit and Enterprise Library collision with IIS Web.Config
And the troubleshooting steps I have taken to come to the answer is available at the following Microsoft forum. ESB Toolkit and Enterprise Library collision with IIS Web.Config
来源:https://stackoverflow.com/questions/16327516/esb-toolkit-and-enterprise-library-collision