Mapping problem accessing application config data RRS feed

  • Question

  • Looking for ways of accessing external strings from BizTalk maps without hard-coding them in the map.  I have found two that work (using an EVAR, and putting an application setting in the machine.config file), and I am researching a third (using the SSO config database). But a fourth method, using the BizTalk application config file, doesn't seem to work, and I don't understand why.
    The application config solution should be exactly the same as the the code that uses the machine.config, because as I understand the process, when BizTalk searches for application configuration data, it will first search the machine.config file in the .NET config folder, and then it will search the BTSNTSvc.exe.config file in the application runtime installation directory.
    I set up a map using a simple custom functoid with the following code:
    public string GetConnectString()
        string connectString = System.Configuration.ConfigurationSettings.AppSettings.Get("MapBookConnectString"); 
        return connectString;
    And I have added the following section to the machine.config file in the C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG
                <add key="MapBookConnectString" value="Data Source=SSPS;Initial Catalog=MappingBook;Trusted_Connection=Yes;" />
    The fuction correctly returns the connect string value from the appSettings entry for MapBookConnectString.  But if I remove it from the machine.config file and place the same appSetting information into the BTNTSvc.exe.config, it returns a null value.  Note that after making the change, I restarted the Biztalk host instance, and when that did't work I also restarted the service. 
    The documentation on the use of the application configuration data is somewhat confusing, and I had a great deal of difficulty finding out exactly what the name and location of the config file was.  Perhaps I have gotten a file in the wrong location?
    Oner note of interest is that when I tested this function, I get a warning that "ConfigurationSettings" is obsolete.  I couldn't get the updated object reference to work.  Is it possible that there is a conflict because the VM has version 2 of .NET installed, but it doesn't look like version 1 and 1.1 were uninstalled?  I'm not sure how to tell which one is being accessed.  When I look at the propertes of the assemblies referenced in the project (System, System.XML and so forth) it indicates that the pathname is to the 2.0 version. 


    Friday, May 16, 2008 2:27 PM


All replies

  • This might not be right place to post this query. This forum is for Biztalk EDI/As2 discussion. Below is forum for any query related to biztalk R2:




    Friday, May 16, 2008 9:49 PM
  • Duh.  You're right Bhola.  Of course we use this stuff for EDI mapping, so I was forgetting that the question was of a general nature rather than specific to EDI.

    Monday, May 19, 2008 2:24 PM



    There are a couple of things you can try

    1.  Use the SSO database to store the settings.  There is a Biztalk sample on how to do this with the mapping functiods.  Richard Seroter created a tool to aid in creating the SSO Store application settings.  His blog post is here


    2.  Create a database to store and retrieve the settings.  I created a database much like the SSO database to store settings on a machine, application, type(development,production) level.  I also created a .NET COM+ DLL to retrieve the settings for the DLL I'm working with (even VB6 and VBScript calls).


    Good Luck,


    Wednesday, May 21, 2008 11:42 PM