Working with BizTalk Configuration File – BTSNTSvc.exe.config

Posted: April 3, 2009 in BizTalk
Tags:

BizTalk server relies on a configuration file to store certain application information.

This config file is located in BizTalk installation directory, normally in:

  • c:\Program Files\Microsoft BizTalk Server 2006\BTSNTSvc.exe.config
  • The default location for these files is %ProgramFiles%\Microsoft BizTalk Server %version%\ on a computer running a 32-bit version of Windows or %ProgramFiles(x86)%\Microsoft BizTalk Server %version%\ on a computer running a 64-bit version of Windows, where’s %version% can be 2006, 2009, 2010…

And is named “BTSNTSvc.Exe.Config“.

(DO NOT CHANGE THIS FILE WITHOUT BACKING UP!!!). This will save a lot of headaches.

Note: the changes in this file are picked up when the host instance restarts.

When you install 64 bit version of BizTalk sever, the application installation folder will have 2 BizTalk configuration files.

  1. BtsNTSvc.exe.config
  2. BtsNTSvc64.exe.config

In majority of the situation you’ll be only using the 64 bit in-process host instances on the server. In that case your entire custom configuration should be placed inside the “BtsNTSvc64.exe.config”.

But occasionally there will be situations, where you need to run some 32 bit host instances as well on the same servers. Example: If you are utilizing any 3rd party components with 32 bit restrictions, or running the some adapters (example: FTP adapter) not supported on 64-bit host instances. So, you need to run them under 32 bit host instances.

In those scenarios, make sure you copy the configuration data to both “BtsNTSvc.exe.config” and “BtsNTSvc64.exe.config”. Because the 32 bit host instances will use the “BtsNTSvc.exe.config” file.

Add External config file in BizTalk Configuration File

In a case of having multiple BizTalk applications on the same BizTalk server, putting all configurations inside the “BtsNTSvc.exe.config” makes it very hard to maintain.

To make easy to maintain the configuration file, we can create external config files (example: per application), and then import the file to the BizTalk configuration file “BtsNTSvc.exe.config”:

1. In the “BtsNTSvc.exe.config” put an entry in the configSections

<?xml version="1.0" ?>
<configuration>
   <configSections>
      <section name="MyAppSettings" type="System.Configuration.NameValueFileSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
   </ configSections>
    …
</configuration>

2. In the “BtsNTSvc.exe.config” put an entry that associate the section with the external file

<?xml version="1.0" ?>
<configuration>
   <configSections>
   …
   </configSections>
   <runtime>
   …
   </runtime>
   <system.runtime.remoting>
   …
   </system.runtime.remoting>

   < MyAppSettings file=" MyApp.config" />

</configuration>

3. Create an external Config file “MyApp.config” with your configuration

<MyAppSettings>
   <add key="ConnectionString" value="…" />
   …
</MyAppSettings>

Special Characters in BizTalk Configuration file

If we want to use special characters like:

  • <, >, ”
  • #, !, &
  • ç, ã, é

In BizTalk configuration file, or in .NET applications, we have translate them and use HTML entities or ISO Latin-1 codes

Regarding the BizTalk configuration file, we have to use

  • For symbols – HTML entities;
  • For diacritics – ISO Latin-1 codes

(Diacritics is a graph signal that arises on, or through a letter to change its phonetic realization (accents, …))

HTML: Special Characters

HTML Entities and/or ISO Latin-1 codes can be placed in source code like any other alphanumeric characters to produce special characters and symbols that cannot be generated in HTML with normal keyboard commands.

For example, to render Düsseldorf the HTML source should read:

  • D&uuml;sseldorf
  • or D&#252;sseldorf
Punctuation HTML Entity
(case sensitive)
ISO Latin-1 code name or meaning
&ndash; &#8211; en dash
&mdash; &#8212; em dash
¡ &iexcl; &#161; inverted exclamation
¿ &iquest; &#191; inverted question mark
&quot; &#34; quotation mark
&ldquo; &#8220; left double curly quote
&rdquo; &#8221; right double curly quote
&#39; apostrophe (single quote)
&lsquo; &#8216; left single curly quote
&rsquo; &#8217; right single curly quote
«


»

&laquo;


&raquo;

&#171;


&#187;

guillemets (European-style quotation marks)
(Its there, but you can’t see it!) &nbsp; &#160; non-breaking space
Symbols
& &amp; &#38; ampersand
¢ &cent; &#162; cent
© &copy; &#169; copyright
÷ &divide; &#247; divide
> &gt; &#62; greater than
< &lt; &#60; less than
µ &micro; &#181; micron
· &middot; &#183; middle dot
&para; &#182; pilcrow (paragraph sign)
± &plusmn; &#177; plus/minus
&euro; &#8364; Euro
£ &pound; &#163; British Pound Sterling
® &reg; &#174; registered
§ &sect; &#167; section
&trade; &#153; trademark
¥ &yen; &#165; Japanese Yen
Diacritics
á


Á

&aacute;


&Aacute;

&#225;


&#193;

lower-case “a” with acute accent


upper-case “A” with acute accent

à


À

&agrave;


&Agrave;

&#224;


&#192;

lower-case “a” with grave accent


upper-case “A” with grave accent

â


Â

&acirc;


&Acirc;

&#226;


&#194;

lower-case “a” with circumflex


upper-case “A” with circumflex

å


Å

&aring;


&Aring;

&#229;


&#197;

lower-case “a” with ring


upper-case “A” with ring

ã


Ã

&atilde;


&Atilde;

&#227;


&#195;

lower-case “a” with tilde


upper-case “A” with tilde

ä


Ä

&auml;


&Auml;

&#228;


&#196;

lower-case “a” with diaeresis/umlaut


upper-case “A” with diaeresis/umlaut

æ


Æ

&aelig;


&AElig;

&#230;


&#198;

lower-case “ae” ligature


upper-case “AE” ligature

ç


Ç

&ccedil;


&Ccedil;

&#231;


&#199;

lower-case “c” with cedilla


upper-case “C” with cedilla

é


É

&eacute;


&Eacute;

&#233;


&#201;

lower-case “e” with acute accent


upper-case “E” with acute accent

è


È

&egrave;


&Egrave;

&#232;


&#200;

lower-case “e” with grave accent


upper-case “E” with grave accent

ê


Ê

&ecirc;


&Ecirc;

&#234;


&#202;

lower-case “e” with circumflex


upper-case “E” with circumflex

ë


Ë

&euml;


&Euml;

&#235;


&#203;

lower-case “e” with diaeresis/umlaut


upper-case “E” with diaeresis/umlaut

í


Í

&iacute;


&Iacute;

&#237;


&#205;

lower-case “i” with acute accent


upper-case “I” with acute accent

ì


Ì

&igrave;


&Igrave;

&#236;


&#204;

lower-case “i” with grave accent


upper-case “I” with grave accent

î


Î

&icirc;


&Icirc;

&#238;


&#206;

lower-case “i” with circumflex


upper-case “I” with circumflex

ï


Ï

&iuml;


&Iuml;

&#239;


&#207;

lower-case “i” with diaeresis/umlaut


upper-case “I” with diaeresis/umlaut

ñ


Ñ

&ntilde;


&Ntilde;

&#241;


&#209;

lower-case “n” with tilde


upper-case “N” with tilde

ó


Ó

&oacute;


&Oacute;

&#243;


&#211;

lower-case “o” with acute accent


upper-case “O” with acute accent

ò


Ò

&ograve;


&Ograve;

&#242;


&#210;

lower-case “o” with grave accent


upper-case “O” with grave accent

ô


Ô

&ocirc;


&Ocirc;

&#244;


&#212;

lower-case “o” with circumflex


upper-case “O” with circumflex

ø


Ø

&oslash;


&Oslash;

&#248;


&#216;

lower-case “o” with slash


upper-case “O” with slash

õ


Õ

&otilde;


&Otilde;

&#245;


&#213;

lower-case “o” with tilde


upper-case “O” with tilde

ö


Ö

&ouml;


&Ouml;

&#246;


&#214;

lower-case “o” with diaeresis/umlaut


upper-case “O” with diaeresis/umlaut

ß &szlig; &#223; ess-tsett
ú


Ú

&uacute;


&Uacute;

&#250;


&#218;

lower-case “u” with acute accent


upper-case “U” with acute accent

ù


Ù

&ugrave;


&Ugrave;

&#249;


&#217;

lower-case “u” with grave accent


upper-case “U” with grave accent

û


Û

&ucirc;


&Ucirc;

&#251;


&#219;

lower-case “u” with circumflex


upper-case “U” with circumflex

ü


Ü

&uuml;


&Uuml;

&#252;


&#220;

lower-case “u” with diaeresis/umlaut


upper-case “U” with diaeresis/umlaut

ÿ &yuml; &#255; lower-case “y” with diaeresis/umlaut
´


`

&#180;


&#96;

acute accent with no letter


grave accent/reversed apostrophe with no letter

Tags: BizTalk

Comments
  1. RV says:

    How to read this custom appsetting config data in Expression shape of the orchestration?

    For directly pulling information from sections, I am using
    System.Configuration.ConfigurationManager.AppSettings.Get(“welcomeInfo”);

    Same doesn’t work when I move the config data to a custom config file and refer the same in BTSNTSvc.exe.config

    • Hi RV,
      I normally use this function:
      public static string GetNameValueFileSectionHandlerKey(string keyname, string section)
      {
      string keyvalue = “”;
      NameValueCollection InitParams;
      InitParams = (NameValueCollection)System.Configuration.ConfigurationManager.GetSection(section);
      keyvalue = InitParams[keyname];
      return keyvalue;
      }

      • Tarun Garg says:

        Hello Sandro,

        I am getting following exception while using above custom section:

        xlang/s engine event log entry: Uncaught exception (see the ‘inner exception’ below) has suspended an instance of service ‘Config_Proj1.BizTalk_Orchestration1(25270535-d3e5-7f2c-25ac-6714e23fd92d)’.
        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: 62bce38d-2b2c-4de0-9c10-e15054ff952e
        Shape name: ConstructMessage_1
        ShapeId: cba72bfa-f863-4a80-a555-e1d964f6f1cc
        Exception thrown from: segment 1, progress 6
        Inner exception: Unrecognized attribute ‘file’. Note that attribute names are case-sensitive. (C:\Program Files (x86)\Microsoft BizTalk Server 2010\BTSNTSvc.exe.Config line 38)

      • Hi Tarun,

        Normally this type of error happens when you are trying to specify another external AppSetting file from within the first external AppSetting file.

        For example: you can’t specify another external AppSetting file MyCommonApp.config file from MyApp.config file, if you are trying to do that, you will get this error.

        But to help you better I need to see your two configuration files: BtsNTSvc.exe.config and MyApp.config; if you want please send me an email with this two files

  2. Tarun Garg says:

    Hello Sandro,

    Thanks for the update. I checked the config files and found the entry in BTSNTsv.exe.config is incorrect. Above problem is resolved after using the correct entry.

    Incorrect:

    Correct:

    Also one strange thing, if I update BTSNTSvc.exe.config with above entry as first thing after tag it works but if I put this entry after then it does not work.

    What is reason for this ?

    • You forgot to put the entries: Incorrect and correct🙂

      • Tarun Garg says:

        Hello Sandro,

        Thanks for the update. I checked the config files and found the entry in BTSNTsv.exe.config is incorrect. Above problem is resolved after using the correct entry.

        Incorrect:

        Correct:

        Also one strange thing, if I update BTSNTSvc.exe.config with above entry as first thing after tag it works but if I put this entry after other tags like then BizTalk host does not start.

        What is reason for this ?

        Tarun Garg

      • Tarun Garg says:

        I think XML tags are removed when I post here…

      • Tarun Garg says:

        Hello Sandro,

        Thanks for the update. I checked the config files and found the entry in BTSNTsv.exe.config is incorrect. Above problem is resolved after using the correct entry.

        Incorrect:

        section name=”BizTalk_Helper1″ type=”System.Configuration.NameValueFileSectionHandler, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″

        Correct:

        section name=”BizTalk_Helper1″ type=”System.Configuration.NameValueFileSectionHandler, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″

        Also one strange thing, if I update BTSNTSvc.exe.config with above entry as first thing after tag configuration it works but if I put this entry after other tags like system.runtime.remoting then BizTalk host does not start.

        What is reason for this ?

        Tarun Garg

  3. ermir zaimi says:

    Hello Sandro,
    i have created a custom library where i enable/disable receive locations.
    in this library i make reference to the Microsoft.BizTalk.ExplorerOM.dll,
    i create a “BtsCatalogExplorer” object that needs a conn string to the mbox database

    The connstring is stored in the ” BTSNTSvc.exe.config” file.(both of them 64 and 32)

    *appSettings*
    *add key=”qwerty” value=”Server=testserver;Database=’BizTalkMgmtDb’;Integrated Security=true”/*
    *appSettings/*

    When i worked in the 2013 standart edition it worked fine,

    I upgraded to the enterprise 2013 R2 edition.

    When i try to call the library it fails with the error

    ————
    Exception thrown from: segment 1, progress 10
    Inner exception: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)

    Exception type: SqlException
    Source: .Net SqlClient Data Provider
    Target Site: Void set_ConnectionString(
    ————
    any idea?

  4. Meenu says:

    Hello Sandro,

    I am also looking for a solution where different BizTalk application can have its own configuration file. Your blog give me some hope of its possibility.What I am not getting is how BizTalk application will be mapped to its ConfiigSection . It will be great if you can share your sample application with me. Thanks in advance.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s