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:
- BtsNTSvc.exe.config
- 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üsseldorf
- or Düsseldorf
Punctuation | HTML Entity (case sensitive) | ISO Latin-1 code | name or meaning |
– | – | – | en dash |
— | — | — | em dash |
¡ | ¡ | ¡ | inverted exclamation |
¿ | ¿ | ¿ | inverted question mark |
“ | " | " | quotation mark |
“ | “ | “ | left double curly quote |
” | ” | ” | right double curly quote |
‘ | ' | apostrophe (single quote) | |
‘ | ‘ | ‘ | left single curly quote |
’ | ’ | ’ | right single curly quote |
«
» | «
» | «
» | guillemets (European-style quotation marks) |
(Its there, but you can’t see it!) | |   | non-breaking space |
Symbols | |||
& | & | & | ampersand |
¢ | ¢ | ¢ | cent |
© | © | © | copyright |
÷ | ÷ | ÷ | divide |
> | > | > | greater than |
< | < | < | less than |
µ | µ | µ | micron |
· | · | · | middle dot |
¶ | ¶ | ¶ | pilcrow (paragraph sign) |
± | ± | ± | plus/minus |
€ | € | € | Euro |
£ | £ | £ | British Pound Sterling |
® | ® | ® | registered |
§ | § | § | section |
™ | ™ | ™ | trademark |
¥ | ¥ | ¥ | Japanese Yen |
Diacritics | |||
á
Á | á
Á | á
Á | lower-case “a” with an acute accent
upper-case “A” with an acute accent |
à
À | à
À | à
À | lower-case “a” with a grave accent
upper-case “A” with a grave accent |
â
 | â
 | â
 | lower-case “a” with circumflex
upper-case “A” with circumflex |
å
Å | å
Å | å
Å | lower-case “a” with ring
upper-case “A” with ring |
ã
à | ã
à | ã
à | lower-case “a” with a tilde upper-case “A” with a tilde |
ä
Ä | ä
Ä | ä
Ä | lower-case “a” with diaeresis/umlaut
upper-case “A” with diaeresis/umlaut |
æ
Æ | æ
Æ | æ
Æ | lower-case “ae” ligature
upper-case “AE” ligature |
ç
Ç | ç
Ç | ç
Ç | lower-case “c” with cedilla
upper-case “C” with cedilla |
é
É | é
É | é
É | lower-case “e” with an acute accent
upper-case “E” with an acute accent |
è
È | è
È | è
È | lower-case “e” with a grave accent upper-case “E” with a grave accent |
ê
Ê | ê
Ê | ê
Ê | lower-case “e” with circumflex
upper-case “E” with circumflex |
ë
Ë | ë
Ë | ë
Ë | lower-case “e” with diaeresis/umlaut
upper-case “E” with diaeresis/umlaut |
í
Í | í
Í | í
Í | lower-case “i” with an acute accent
upper-case “I” with an acute accent |
ì
Ì | ì
Ì | ì
Ì | lower-case “i” with a grave accent upper-case “I” with a grave accent |
î
Î | î
Î | î
Î | lower-case “i” with circumflex
upper-case “I” with circumflex |
ï
Ï | ï
Ï | ï
Ï | lower-case “i” with diaeresis/umlaut
upper-case “I” with diaeresis/umlaut |
ñ
Ñ | ñ
Ñ | ñ
Ñ | lower-case “n” with a tilde upper-case “N” with a tilde |
ó
Ó | ó
Ó | ó
Ó | lower-case “o” with an acute accent upper-case “O” with an acute accent |
ò
Ò | ò
Ò | ò
Ò | lower-case “o” with a grave accent upper-case “O” with a grave accent |
ô
Ô | ô
Ô | ô
Ô | lower-case “o” with circumflex
upper-case “O” with circumflex |
ø
Ø | ø
Ø | ø
Ø | lower-case “o” with a slash upper-case “O” with a slash |
õ
Õ | õ
Õ | õ
Õ | lower-case “o” with a tilde upper-case “O” with a tilde |
ö
Ö | ö
Ö | ö
Ö | lower-case “o” with diaeresis/umlaut
upper-case “O” with diaeresis/umlaut |
ß | ß | ß | ess-tsett |
ú
Ú | ú
Ú | ú
Ú | lower-case “u” with an acute accent upper-case “U” with an acute accent |
ù
Ù | ù
Ù | ù
Ù | lower-case “u” with a grave accent
upper-case “U” with a grave accent |
û
Û | û
Û | û
Û | lower-case “u” with circumflex
upper-case “U” with circumflex |
ü
Ü | ü
Ü | ü
Ü | lower-case “u” with diaeresis/umlaut
upper-case “U” with diaeresis/umlaut |
ÿ | ÿ | ÿ | lower-case “y” with diaeresis/umlaut |
´
` | ´
` | acute accent with no letter
grave accent/reversed apostrophe with no letterAdvance Configurations |
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;
}
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)
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
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 🙂
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
I think XML tags are removed when I post here…
Send me an email.
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
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?
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.
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.