Working with BizTalk Configuration File – BTSNTSvc.exe.config

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 %version%\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 a 64-bit version of BizTalk Server, the application installation folder will have 2 BizTalk configuration files:

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

In the majority of the situations, 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 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 to 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
PunctuationHTML Entity
(case sensitive)
ISO Latin-1 codename 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 an acute accent

 


upper-case “A” with an acute accent

à

 


À

&agrave;

 


&Agrave;

&#224;

 


&#192;

lower-case “a” with a grave accent

 


upper-case “A” with a 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 a tilde  



upper-case “A” with a

tilde

ä

 


Ä

ä

 



Ä

&#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 an acute accent

 


upper-case “E” with an acute accent

è

 


È

&egrave;

 


&Egrave;

&#232;

 


&#200;

lower-case “e” with a grave accent 



upper-case “E” with a

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 an acute accent

 


upper-case “I” with an acute accent

ì

 


Ì

&igrave;

 


&Igrave;

&#236;

 


&#204;

lower-case “i” with a grave accent  



upper-case “I” with a

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 a tilde  




upper-case “N” with a

tilde

ó

 


Ó

&oacute;

 


&Oacute;

&#243;

 


&#211;

lower-case “o” with an acute accent  



upper-case “O” with an

acute accent

ò

 


Ò

&ograve;

 


&Ograve;

&#242;

 


&#210;

lower-case “o” with a grave accent  



upper-case “O” with a

grave accent

ô

 


Ô

&ocirc;

 


&Ocirc;

&#244;

 


&#212;

lower-case “o” with circumflex

 


upper-case “O” with circumflex

ø

 


Ø

&oslash;

 


&Oslash;

&#248;

 


&#216;

lower-case “o” with a slash  


upper-case “O” with a

slash

õ

 


Õ

&otilde;

 


&Otilde;

&#245;

 


&#213;

lower-case “o” with a tilde  

upper-case “O” with a

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 an acute accent
 
upper-case “U” with an

acute accent

ù

 


Ù

&ugrave;

 


&Ugrave;

&#249;

 


&#217;

lower-case “u” with a grave accent

 


upper-case “U” with a 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 letterAdvance Configurations

#1 all-in-one platform for Microsoft BizTalk Server
management and monitoring
Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

13 thoughts on “Working with BizTalk Configuration File – BTSNTSvc.exe.config”

  1. 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

    1. 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;
      }

      1. 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 2010BTSNTSvc.exe.Config line 38)

        1. 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. 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 ?

      1. 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

      2. 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. 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. 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.

  5. hello Sandro,

    I migrating to biztalk2020 and i’m having this issue on the eUAT environment :
    biztalk is picking up the machine.config file instead of the External config file in BizTalk Configuration File , helo please.

Leave a Reply

Your email address will not be published. Required fields are marked *

turbo360

Back to Top