Reading config file from Orchestration

Home Page Forums BizTalk 2004 – BizTalk 2010 Reading config file from Orchestration

Viewing 1 reply thread
  • Author
    Posts
    • #16407

      I have a biztalk project  named "InfoReader" which has an orchestration. This orch reads the config file in th expression shape using the code as shown below

      EmpID = System.Configuration.ConfigurationManager.AppSettings["EmpId"];

      EmpSSN = System.Configuration.ConfigurationManager.AppSettings["EmpSsn"];

      where EmpID and EmpSSN are orchestration variables.

      Now, my InfoReader.dll.config looks like this

      <?xml version="1.0" encoding="utf-8" ?>
      <configuration>
          <appSettings>
              <add key="EmpId" value="100" />
              <add key="EmpSsn" value="111-22-3333" />
          </appSettings>
      </configuration>

      When I run my orchestration, I am getting exception below

      Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'InfoReader.ReadConfigOrchestration(487d0f7f-1ae1-c847-847e-e438a8ab2117)'.
      The service instance will remain suspended until administratively resumed or terminated.
      If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
      InstanceId: d31a5f64-ce4d-4970-a9ee-e9581c9de2a1
      Shape name: ConstructMessage_1
      ShapeId: 50f5c442-44d0-4781-952e-6d7b4b4f2f3a
      Exception thrown from: segment 1, progress 12
      Inner exception: Value cannot be null.
      Parameter name: val

      For some reason, the code in the expression fails to read the config file.

      What should be the name of the config and where should I put it ?

      (Right now the config file (InfoReader.dll.config) is in ..\bin\development\ directory the same place where my orchestration dll is )

      Any help on this is greatly appreciated.

      (Sorry for the long post… 🙂 just wanted to give you guys every minute detail )

    • #16409

      See Buddy,

      The Orchestration access btsntsvc.exe.config file .

      So you need to add your key/value pairs in btsntsvc.exe.config file and not in inforeader.dll.config

       Hope you find it useful.

       

       

      • #16414

        Thank you that worked for me. However, the key point in here is to put your settings at the very top of the config file.

        so the structure would look like as shown below

        <?xml version="1.0" ?>
        <configuration>
            <appSettings>

                   // custom key/value pair goes here
            </appSettings>

            <runtime>
           </runtime>
           
            <system.runtime.remoting>
           
                <channelSinkProviders>
                    <serverProviders>
                        <provider id="sspi"

        type="Microsoft.BizTalk.XLANGs.BTXEngine.SecurityServerChannelSinkProvider,Microsoft.XLANGs.BizTalk.Engi

        ne" 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> 
        </configuration>

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