How to retrive Config Values from BizTalk Config File

Home Page › Forums › BizTalk 2004 – BizTalk 2010 › How to retrive Config Values from BizTalk Config File

Viewing 1 reply thread
  • Author
    Posts
    • #23663

      Hi All I’m unable retrive config values which I have added in BziTalk Config File from Orchestration..I did following..

      In BTSNTSvc.exe.config File I have following Xml Tags–

      <appSettings>
      <add key = “IsDebugEnabled” value=”true”add>

      </appSettings>

      and from Orchestration Expression shape, I’m doing following things..

      strDebugValue= System.Configuration.ConfigurationSettings.AppSettings.Get(“IsDebugEnabled“);

      When I’m Logging strDebugValue …I’m not getting anything.

      Please Help!!

       

    • #23665

      Hi,

       

         Here’s what you should have in your BTSNTSvc.exe.config file (your original syntax is incorrect):

      <appSettings>

      <add key=”IsDebugEnabled” value=”true” />
      </appSettings>

       

          Make sure to place the appSettings section after the configSections section. After you save the configuration file, start and stop the BizTalk application service on your server, so that the changes are refreshed. The code in your Expression shape in the Orchestration is correct.

       

         Daniel.

       

       

      • #23667

        Thanks for your reply Daniel,

        Actual there was an typo in my previous post …

        Its was

        <appSettings>
        <add key = “IsDebugEnabled” value=”true”> </add>

        </appSettings>

        I also tried Like u said

        <appSettings>

        <?xml version=”1.0″ ?>
        <configuration>
         <configSections>
          <section name=”loggingConfiguration” type=”Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings,

        Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a” />
          <section name=”dataConfiguration” type=”Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings,

        Microsoft.Practices.EnterpriseLibrary.Data, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a” />
          <section name=”xlangs” type=”Microsoft.XLANGs.BizTalk.CrossProcess.XmlSerializationConfigurationSectionHandler,

        Microsoft.XLANGs.BizTalk.CrossProcess” />
         </configSections>
        <appSettings>
        <add key = “IsDebugEnabled” value=”true”></add>
        </appSettings>

            <runtime>
                <assemblyBinding xmlns=”urn:schemas-microsoft-com:asm.v1″>
                    <probing privatePath=”BizTalk Assemblies;Developer Tools;Tracking;Tracking\interop” />
                </assemblyBinding>
            </runtime>
           
            <system.runtime.remoting>
           
                <channelSinkProviders>
                    <serverProviders>
                        <provider id=”sspi” type=”Microsoft.BizTalk.XLANGs.BTXEngine.SecurityServerChannelSinkProvider,Microsoft.XLANGs.BizTalk.Engine”

        securityPackage=”ntlm” authenticationLevel=”packetPrivacy” />
                    </serverProviders>
                </channelSinkProviders>
           
                <application>
                    <channels>
                        <channel ref=”tcp” port=”0″ name=””>
                         <serverProviders>
                             <provider ref=”sspi” />
                                <formatter ref=”binary” typeFilterLevel=”Full”/>
                            </serverProviders>
                        </channel>
                    </channels>
                </application>
            </system.runtime.remoting>
         <xlangs>
          <Configuration>
           
           <AppDomains AssembliesPerDomain=”11″>
            <AppDomainSpecs>
             <AppDomainSpec Name=”TestSQLDeadlock” SecondsIdleBeforeShutdown=”-1″ SecondsEmptyBeforeShutdown=”12000″>
              <BaseSetup>
               

        <ConfigurationFile>C:\SriniBTS\TestSQLDeadlock\CurrentVersion\Config\TestSQLDeadlock.dll.config</ConfigurationFile>
              </BaseSetup>
             </AppDomainSpec>
             <AppDomainSpec Name=”InformToMacess” SecondsIdleBeforeShutdown=”-1″ SecondsEmptyBeforeShutdown=”12000″>
              <BaseSetup>
               

        <ConfigurationFile>C:\Development\BT2006\Sales\Interfaces\InformToMacess\CurrentVersion\ConfigFile</ConfigurationFile>
              </BaseSetup>
             </AppDomainSpec>
            
            </AppDomainSpecs>
            <ExactAssignmentRules>
             
             <ExactAssignmentRule AssemblyName=”TestSQLDeadlock, Version=1.0.0.0, Culture=neutral,

        PublicKeyToken=87314506316f020d” AppDomainName=”TestSQLDeadlock” />
            <ExactAssignmentRule AssemblyName=”InformToMacess, Version=1.0.0.0, Culture=neutral, PublicKeyToken=87314506316f020d”

        AppDomainName=”InformToMacess” />
            </ExactAssignmentRules>   

           </AppDomains>
          </Configuration>
         </xlangs>
           
        </configuration>

         

        <add key=”IsDebugEnabled” value=”true” />
        </appSettings> and I placed my  appSettings section after the configSections section..I mentioned my Complete BizTalk Config File below

        • #23668

          This is my config..

          <?xml version=”1.0″ ?>

          – <configuration>
          – <configSections>
            <section name=”loggingConfiguration“ type=”Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a“ />
            <section name=”dataConfiguration“ type=”Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a“ />
            <section name=”xlangs“ type=”Microsoft.XLANGs.BizTalk.CrossProcess.XmlSerializationConfigurationSectionHandler, Microsoft.XLANGs.BizTalk.CrossProcess“ />
            </configSections>
          – <appSettings>
            <add key=”IsDebugEnabled“ value=”true“ />
            </appSettings>
          – <runtime>
          – <assemblyBinding xmlns=”urn:schemas-microsoft-com:asm.v1“>
            <probing privatePath=”BizTalk Assemblies;Developer Tools;Tracking;Tracking\interop“ />
            </assemblyBinding>
            </runtime>
          – <system.runtime.remoting>
          – <channelSinkProviders>
          – <serverProviders>
            <provider id=”sspi“ type=”Microsoft.BizTalk.XLANGs.BTXEngine.SecurityServerChannelSinkProvider,Microsoft.XLANGs.BizTalk.Engine“ securityPackage=”ntlm“ authenticationLevel=”packetPrivacy“ />
            </serverProviders>
            </channelSinkProviders>
          – <application>
          – <channels>
          – <channel ref=”tcp“ port=”0“ name=”“>
          – <serverProviders>
            <provider ref=”sspi“ />
            <formatter ref=”binary“ typeFilterLevel=”Full“ />
            </serverProviders>
            </channel>
            </channels>
            </application>
            </system.runtime.remoting>
          – <xlangs>
          – <Configuration>
          – <AppDomains AssembliesPerDomain=”11“>
          – <AppDomainSpecs>
          – <AppDomainSpec Name=”TestSQLDeadlock“ SecondsIdleBeforeShutdown=”-1“ SecondsEmptyBeforeShutdown=”12000“>
          – <BaseSetup>
            <ConfigurationFile>C:\SriniBTS\TestSQLDeadlock\CurrentVersion\Config\TestSQLDeadlock.dll.config</ConfigurationFile>
            </BaseSetup>
            </AppDomainSpec>
          – <AppDomainSpec Name=”InformToMacess“ SecondsIdleBeforeShutdown=”-1“ SecondsEmptyBeforeShutdown=”12000“>
          – <BaseSetup>
            <ConfigurationFile>C:\Development\BT2006\Sales\Interfaces\InformToMacess\CurrentVersion\ConfigFile</ConfigurationFile>
            </BaseSetup>
            </AppDomainSpec>
            </AppDomainSpecs>
          – <ExactAssignmentRules>
            <ExactAssignmentRule AssemblyName=”TestSQLDeadlock, Version=1.0.0.0, Culture=neutral, PublicKeyToken=87314506316f020d“ AppDomainName=”TestSQLDeadlock“ />
            <ExactAssignmentRule AssemblyName=”InformToMacess, Version=1.0.0.0, Culture=neutral, PublicKeyToken=87314506316f020d“ AppDomainName=”InformToMacess“ />
            </ExactAssignmentRules>
            </AppDomains>
            </Configuration>
            </xlangs>
            </configuration>
          • #23669

            Hi,

             

               You should remove that extra tag </add> from the section appSettings in your configuration file. When in doubt, use the Enterprise Library Configuration tool to open, edit and save the BTSNTSvc configuration file.

             

               Cheers,

             

               Daniel.

             

             

             

            • #23670

              I removed </add> tag but still not able to get the value in orchestration..:( 

              • #23671

                Hi,

                 

                   I checked the contents of your BTSNTSvc configuration file and nothing jumps out that would indicate something out of place. Did you restart your BizTalk application service after you made the changes? Another thing you can do is clean up your configuration file and remove any unnecessary tags/sections.

                 

                   Daniel.

                 

                • #23672

                  Thanks for your valuable  time Daniel….I have restrated Host Instance…I will get back to abount status.

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.