Microsoft Developer Network > Forums Home > BizTalk Server Forums > BizTalk ESB Toolkit > ESB Toolkit 2.1 and Stand Alone Enterprise Library 5.0 Application Configuration Issue

Answered ESB Toolkit 2.1 and Stand Alone Enterprise Library 5.0 Application Configuration Issue

  • Tuesday, April 26, 2011 2:13 PM
     
      Has Code

    Hi All -

    I have a development server that has both the enterprise library version 4.1 and 5.0 installed and working fine. After installing the ESB Toolkit 2.1 my stand-alone applications using Enterprise Library 5.0 are broken. I read about the ESB toolkit modifying machine.config etc.

    There are several posts regarding this issue with stand-alone applications using version 4.1 of the enterprise library (inserting some XML changes to stand-alone web/app.config files) to fix the issue. But I haven't read anything specific to web/app.config files for stand-alone applications using version 5.0. Can someone who has this working please post explicitly the XML configuration file changes to be inserted into stand-alone XML web/app.config file? Everything I've tried so far does not seem to work...

    I've included my sample XML using the cryptography block: 

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <configSections>
       <section name="securityCryptographyConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Configuration.CryptographySettings, Microsoft.Practices.EnterpriseLibrary.Security.Cryptography, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
       <section name="enterpriseLibrary.ConfigurationSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      </configSections>
    
      <enterpriseLibrary.ConfigurationSource selectedSource="Local File Configuration Source">
       <sources>
         <add name="Local File Configuration Source" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" filePath="C:\Temp\EntLib5Solution\EntLib5ConsoleApp\bin\Debug\EntLib5ConsoleApp.exe.config" />
       </sources>
      </enterpriseLibrary.ConfigurationSource>
    
      <securityCryptographyConfiguration>
       <symmetricCryptoProviders>
         <add name="RijndaelManaged" type="Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.SymmetricAlgorithmProvider, Microsoft.Practices.EnterpriseLibrary.Security.Cryptography, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
           algorithmType="System.Security.Cryptography.RijndaelManaged, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
           protectedKeyFilename="C:\Temp\EntLib5Solution\EntLib5ConsoleApp\CryptoKey.key"
           protectedKeyProtectionScope="LocalMachine" />
       </symmetricCryptoProviders>
      </securityCryptographyConfiguration>
    </configuration>
    

Answers

  • Wednesday, April 27, 2011 6:40 AM
     
     Answered Has Code

    The ESB Toolkit installation changes the machine.config files to use the SSO as a configuration repository. Thus each time you launch your custom applications, they check inside the SSO for their configuration instead of the configuration file.

    To override this, simply add the local configuration source in your configuration file.

    <enterpriseLibrary.ConfigurationSource selectedSource="Local Application Configuration Source">
      <sources>
       <add name="Local File Configuration Source" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" filePath="C:\Temp\EntLib5Solution\EntLib5ConsoleApp\bin\Debug\EntLib5ConsoleApp.exe.config" />
        <add name="Local Application Configuration Source" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" filePath="YourApplication.exe.config" />
     </sources>
    </enterpriseLibrary.ConfigurationSource>
    In this sample i kept the original reference but you dont have to.
    If you have test projects you might have to add an app.config file in your test projects redirecting the configuration source to a local file too.

    I hope this helps.

     


    Hautecoeur F. MCTS Biztalk 2006 MCTS WCF 3.5, 4.0