This document assumes that the reader has at least a basic understanding of XML and the use of .NET configuration files. For a thorough introduction to .NET configuration files, please consult the Configuration Files topics in the .NET framework documentation.
To configure your DataGate application to use the Bidi plug-in (or any other alternate encoding engine), the .NET configuration file must contain an <applicationSettings> element referring to the factory class’ assembly-qualified name. For example, the following is a .NET application configuration file containing only the elements required to configure the plug-in.
Note that some of these elements may already be present in an existing configuration, but the <ASNA.DataGate.Client.Properties.AltEncodingProps> element must be unique in the file.
<?xml version ="1.0"?> <configuration> <configSections> <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > <section name="ASNA.DataGate.Client.Properties.AltEncodingProps" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> </sectionGroup> </configSections> <applicationSettings> <ASNA.DataGate.Client.Properties.AltEncodingProps> <setting name="EncodingFactoryImpl" serializeAs="String"> <value> ASNA.DataGate.DataLink.Bidi.EncodingFactory, ASNA.DataGate.DataLink.Bidi, Version=9.1.0.0, Culture=neutral, PublicKeyToken=f1b0bf4120ba8afa </value> </setting> </ASNA.DataGate.Client.Properties.AltEncodingProps> </applicationSettings> </configuration>
To apply these settings to all DataGate programs that run on the computer, you can merge the above settings into the “machine.config” file. Machine.config can be found in the %runtime install path%\Config directory, where %runtime install path% is the directory containing the version of the .NET framework in use. For the .NET 2.0 framework, this directory is typically “C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config”.
Before editing machine.config, make a backup copy. Use extreme caution when editing machine.config; as the settings here affect all .NET applications on the computer.
Note that machine.config already contains a <configSections> element, but that you will probably need to add the <sectionGroup> element above (and its child elements), as a child of <configSections>. If it already exists in machine.config, add the above <section> element to it as a child.
Likewise, add the <applicationSettings> element above (and its children) to the <configuration> element of machine config, unless it already exists as a System.Configuration.ApplicationSettingsGroup type. If <applicationSettings> already exists, add the <ASNA.DataGate.Client.Properties.AltEncodingProps> element above (and its children) to it.
If another <applicationSettings> element already exists in machine.config, but does not have ‘type="System.Configuration.ApplicationSettingsGroup…’, then give the above <applicationSettings> element a different name; such as <applicationSettingsForASNA>.
The following listing is an example of a name collision with a pre-existing <applicationSettings> element that is resolved by renaming the ASNA element. Omitted portions of machine.config are denoted below by the “…” ellipsis:
<?xml version ="1.0"?> <configuration> <configSections> … <sectionGroup name="applicationSettings" type="SomeOtherApp.SettingsGroup, SomeOtherApp, Version=1.0.0.0" > … </sectionGroup> … <sectionGroup name="applicationSettingsForASNA" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > <section name="ASNA.DataGate.Client.Properties.AltEncodingProps" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> </sectionGroup> </configSections> … <applicationSettingsForASNA> <ASNA.DataGate.Client.Properties.AltEncodingProps> <setting name="EncodingFactoryImpl" serializeAs="String"> <value> ASNA.DataGate.DataLink.Bidi.EncodingFactory, ASNA.DataGate.DataLink.Bidi, Version=9.1.0.0, Culture=neutral, PublicKeyToken=f1b0bf4120ba8afa </value> </setting> </ASNA.DataGate.Client.Properties.AltEncodingProps> </applicationSettingsForASNA> … </configuration>
To specify that a different encoding engine be used, say for a new version of <b>ASNA.DataGate.DataLink.Bidi</b>, the only change required to the above configuration is the text content of the <value> element.