none
Is it possible to Set values in BTSNTSvc.config ?

    Question

  • Hi,

    I am able to read the value form the BTSNTSvc.config from the biztalk orchestration, is it possible to set the value for the same variable after reading the value.

    For Ex:

    <appSettings>
        <add key="SQLErrorCount" value="4" />
    </appSettings>

    Using System.Configuration.ConfigurationSettings.Appsettings.Get(SQLErrorCount) i am able to read the value and stored in the variable.

    Using System.Configuration.ConfigurationSettings.Appsettings.Set(SQLErrorCount,7)  i am unable to set the value for the varialbe, is it possible to edit the value using any property in BTSNTSvc.config???

    Please let me know the feasibilty:) 


    Regards, Aboorva Raja R Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    Wednesday, September 11, 2013 11:31 AM

Answers

  • Please be aware that a BizTalk Group can have multiple Servers (hence: multiple Config files). If a single Host Instance were to write to a Config file on a single Server you would get a mismatch between config files.

    Use the SSODB or a custom depository for storing your dynamic values.

    Morten la Cour

    Wednesday, September 11, 2013 11:34 AM

All replies

  • Please be aware that a BizTalk Group can have multiple Servers (hence: multiple Config files). If a single Host Instance were to write to a Config file on a single Server you would get a mismatch between config files.

    Use the SSODB or a custom depository for storing your dynamic values.

    Morten la Cour

    Wednesday, September 11, 2013 11:34 AM
  • To answer your specific question, no.  This is a .Net issue, nothing to do with BizTalk specifically.  As I recall, there is no method to change the values in a .config file programmatically at all.  That's what the while Settings framework was/is for.

    Can you describe more what you're trying to do?  We can probably offer some more suitable alternatives.

    Wednesday, September 11, 2013 12:34 PM
  • I agree with Morten and batseller. config file is not a good choice in BizTalk. SSO is much better.

    Leonid Ganeline [BizTalk MVP] BizTalk: the Naming Conventions in Examples

    Wednesday, September 11, 2013 8:10 PM
  • Like other I would too recommend you to use SSO to store the configuration as it is much easier to maintain if you have multiple machines in your environment. To see a demo refer to this sample.


    Please mark the post answered your question as answer, and mark other helpful posts as helpful, it'll help other users who are visiting your thread for the similar problem, Regards -Rohit Sharma (http://rohitt-sharma.blogspot.com/)

    Thursday, September 12, 2013 4:00 AM
  • Hi,

    We can get the value and set the values from BTNSvc.config file.

    I tested an scenario in that i am able to use the variable as a Global Variable.

    My scenario is use to fetch values from a config file and set the value at the same time for a parellely runnning instance, once the variable is fetched , i increment the variable by 1 and setting to the config,  then the next instance will fetch the setted value after the increment.

    This scenario is worked fine. But if i go for SSO or Config file it is not working.

    I want to know is there any other oprion to store the value globally in BizTalk. 


    Regards, Aboorva Raja R Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, October 01, 2013 10:45 AM
  • As mentioned by all use SSO for storing your value instead config file in BizTalk server. Since it is a much better choice.

    http://www.athenainfotech.co.uk/free-biztalk-health-check

    Thursday, October 03, 2013 12:36 PM
  • So, what you're really asking for is not really a config value but a global application variable.

    Taking a step back, do the processes have to in parallel?  By incrementing, it implies an ordered process so there might be a better way to handle this.

    Thursday, October 03, 2013 12:48 PM
  • Hi,

    We can get the value and set the values from BTNSvc.config file.

    I tested an scenario in that i am able to use the variable as a Global Variable.

    My scenario is use to fetch values from a config file and set the value at the same time for a parellely runnning instance, once the variable is fetched , i increment the variable by 1 and setting to the config,  then the next instance will fetch the setted value after the increment.

    This scenario is worked fine. But if i go for SSO or Config file it is not working.

    I want to know is there any other oprion to store the value globally in BizTalk. 



    Regards, Aboorva Raja R Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, October 03, 2013 12:48 PM