Revision #12

You are currently reviewing an older revision of this page.
Go to current version

Introduction

There are a couple of options a developer can have when comes to using configurable values. These options can be divided into two categories:

  • File: BTSNTSvc.exe.config, Custom config file, Enterprise Library
  • Database: Business Rule Engine, SSO, or Custom database
  • Registry

This article will provide guidance on each of possible options.

BTSNTSvc.exe.config file

The BizTalk orchestration engine uses an XML file called BTSNTSvc.exe.config to determine certain behaviors. This file attaches to the main executable BTSNTSvc.exe. Any changes placed in BTSNTSvc.exe.config apply to all host instance regardless of their names. This file is always located in the same directory as the BTSNTSvc.exe file, which is usually C:\Program Files\Microsoft BizTalk Server 2010. Any changes in this file will result in a restart of BizTalk Host Instance.

Blogs

Custom Config File

A custom configuration file (.config) can be option to store configuration data that you can use within BizTalk orchestration for instance. A custom config can be easier to maintain that BTSNTSvc.exe.config file.You can choose whether or not to use Enterprise Library or custom code. Enterprise Library may be too much overhead to just access a custom file. Accessing a .config file can be done using simple .NET code, using the System.Configuration namespace.

Registry

Another option is accessing the registry to obtain configuration values. Through custom code in .NET Helper Class using Microsoft.Win32 namespace you can access the registry and read values.

[Serializable]
   
public static class REGISTRYConfigHelper
   
{
       
/// <summary>
        /// Return value from registry
        /// </summary>
        /// <param name="subKey">subKey in the Hive</param>
        /// <param name="value">Value from subKey</param>
        /// <returns>Request value from the subKey</returns>
        public static string Read(string subKey, string value)
       
{
           
// Create value variable
            string retValue = null;

           
// Opening the registry key
            RegistryKey rk = Registry.CurrentUser;

           
// Open a subKey as read-only
            RegistryKey sk1 = rk.OpenSubKey(subKey,RegistryKeyPermissionCheck.ReadSubTree,System.Security.AccessControl.RegistryRights.FullControl);

           
// If the RegistrySubKey does exist
            if (sk1 != null)
           
{
               
try
               
{
                   
// If the RegistryKey exists get its value or null is returned.
                    retValue = (string)sk1.GetValue(value.ToUpper());
               
}
               
catch (Exception e)
               
{
                   
System.Diagnostics.Trace.WriteLine(e.Message);
                   
throw;
               
}
           
}

           
// Return value
            return retValue;
       
}

   
}

Business Rule Engine

Content to be added.

SSO Database

Content to be added.

Custom Database

Content to be added.

Samples

There are a couple of samples available demonstrating the options:

See Also

Content to be added.


Revert to this revision