Add sections to the BTSNTSvc.exe.config

Topics: General Questions
Oct 21, 2010 at 4:09 PM

Is there a way to automate the modification of the BTSNTSvc.exe.config in terms being able to add WCF bindings (horrible design I know but I have to live with it for the time being) and appSettings? I searched but did not see anything outside of the AppDomain stuff.

Oct 21, 2010 at 4:47 PM

Nothing that's built in...  if you want you could write a custom MSBuild task (they are really easy to write) that uses the .NET System.Configuration API to open the config file and write the new data into it.  I think WCF even has its own configuration-related API that you could use.  There are some existing MSBuild tasks to write to XML files, but I doubt that they would work with the complexity of the WCF configuration.


Oct 27, 2010 at 11:24 PM
Edited Dec 20, 2010 at 3:08 PM

You could probably just call XMLPreprocess directly (i.e. a command line step you manually run after the BTDF deploy), and do a substitution from an Excel/XML spreadsheet like we do with BTDF.  [Instead of having a PortBindingMaster.xml you could have a BTNTSvcExeConfigMaster.xml.]

This might be a nice feature in future release.  You can currently store AppSetting type variables in SSO instead, but I think we all still like the ability to update the text config file.

Yesterday, I did a deploy, and had some non-trivial config file changes to merge.  We are also thinking about using XMLPreprocessor on our web.configs (I had some prior posts on this about 7 months ago, and now at a new company, looking at it again).

Also, I was noticing the other day some of the AppDomains in the Config file.  I assume you must be calling a C# that calls a WebService? You might be able to keep the config of that separately by specifying a different config for the AppDomain.  Not sure, haven't tried it, but that's what the doc seemed to mention.

Neal Walters