PC Review


Reply
Thread Tools Rate Thread

Automatic merge of config files

 
 
Yash
Guest
Posts: n/a
 
      2nd Apr 2009
In our production environments we have the app.config files for
version 1.0 of our app. On each server the file contains a number of
settings including connection strings, WCF endpoints etc. which were
made by the deployment engineer.

When version 2.0 is released, it will have a number of more sections
added to the config file. We would like to merge the new config file
with the existing one such that:
-For sections and parameters that have not changed, the existing
setting will be retained.
-New sections will be added with the values as given in the new config
file.
-Sections that have been deleted in the new file will be deleted from
the existing file.

Is there a tool to do this automatically?

Thanks,
Yash
 
Reply With Quote
 
 
 
 
Cesar
Guest
Posts: n/a
 
      2nd Apr 2009
Use WinMerge, it rocks.

Look at http://winmerge.org/




"Yash" <(E-Mail Removed)> wrote in message
news:b1fa8009-ae46-4020-8645-(E-Mail Removed)...
> In our production environments we have the app.config files for
> version 1.0 of our app. On each server the file contains a number of
> settings including connection strings, WCF endpoints etc. which were
> made by the deployment engineer.
>
> When version 2.0 is released, it will have a number of more sections
> added to the config file. We would like to merge the new config file
> with the existing one such that:
> -For sections and parameters that have not changed, the existing
> setting will be retained.
> -New sections will be added with the values as given in the new config
> file.
> -Sections that have been deleted in the new file will be deleted from
> the existing file.
>
> Is there a tool to do this automatically?
>
> Thanks,
> Yash



 
Reply With Quote
 
sloan
Guest
Posts: n/a
 
      2nd Apr 2009
You can clean it up a little like this:

This will allow you to granularize the settings.
The only downside is that with an update to web.config , you get a recycle,
(thus a fresh "read").
Changing these values in the subfiles won't recycle.

The other nuance is that you have to write post build events to copy the
files into /bin/ if you're doing anything besides an web application.




<?xml version="1.0" encoding="utf-8" ?>
<configuration>

<appSettings file="CustomAppSettings.config" >
</appSettings>

<connectionStrings configSource="ExternalConnectionStrings.config" />

<system.serviceModel>
<behaviors configSource="WCFBehaviors.config">
</behaviors>
<bindings configSource="WCFBindings.config">
</bindings>
<client configSource="WCFClient.config" >
</client>
<services configSource="WCFServices.config" >
</services>
</system.serviceModel>
<system.diagnostics configSource="SystemDiagnostics.config">
</system.diagnostics>

</configuration>



There are too many files to put there, but here is ONE example of the
external file:


//WCFBehaviors.config <<
<behaviors>

<serviceBehaviors>

<behavior name="DefaultThrottlingBehavior">

<serviceThrottling maxConcurrentCalls="25"

maxConcurrentSessions="25"

maxConcurrentInstances="25" />

</behavior>

</serviceBehaviors>

</behaviors>

//END WCFBehaviors.config <<


For an empty file, you can just have something like this

//START WCFClient.config (This is my client file on the SERVER side..thus
its empty
<client/>

//END WCFClient.config

I keep all this stuff granularized because its makes for a tidier app.config
or web.config.
Geeze, those things can get big fast!


This isn't an exact answer to your question, but I think it will provide
some value to you.










"Yash" <(E-Mail Removed)> wrote in message
news:b1fa8009-ae46-4020-8645-(E-Mail Removed)...
> In our production environments we have the app.config files for
> version 1.0 of our app. On each server the file contains a number of
> settings including connection strings, WCF endpoints etc. which were
> made by the deployment engineer.
>
> When version 2.0 is released, it will have a number of more sections
> added to the config file. We would like to merge the new config file
> with the existing one such that:
> -For sections and parameters that have not changed, the existing
> setting will be retained.
> -New sections will be added with the values as given in the new config
> file.
> -Sections that have been deleted in the new file will be deleted from
> the existing file.
>
> Is there a tool to do this automatically?
>
> Thanks,
> Yash



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic merge of config files Yash Microsoft Dot NET 2 2nd Apr 2009 09:32 PM
encrypting config file that aren't web config files... Ollie Riches Microsoft ASP .NET 1 4th Dec 2008 04:59 PM
What is the significance of link.exe.config and cl.exe.config files in VS2003 wn123456@gmail.com Microsoft Dot NET Framework 0 3rd May 2007 08:45 AM
Automatic config files keeps disapearing =?Utf-8?B?bHVrZXRoZXB1bms=?= Microsoft Windows 2000 Active Directory 3 22nd Dec 2004 07:09 PM
Re: how to easily merge exe.config files ??? Jay B. Harlow [MVP - Outlook] Microsoft C# .NET 2 8th Aug 2003 02:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:59 PM.