Reputation: 21751
I have a scenario where 1 Winform app is installed on multiple Citrix servers. The app should have exactly the same configuration on each server (we have multiple servers for scale).
I would like to be able to share just 1 copy of the app.config file, so that I can make a change in 1 place and have it effect every installation of the application.
As nearly as I can tell, the only built-in support from .net is to use the configSource attribute, but that only works for individual config sections. I would like to share the whole config file (or at least config groups).
Am I missing anything built into .net that would help me?
If not, are there any good third party or open source solutions out there?
Upvotes: 0
Views: 366
Reputation: 26698
This is possible to use "shared" folder created with something like SkyDrive, Dropbox or even DFS.
On each server you will have same copy of the config file. As a benefit you can use this approach even for binary files (you should deal with file locks of course).
I was using this approach
Upvotes: 0
Reputation: 15772
Another good solution described in SO is to use config includes. Use XML includes or config references in app.config to include other config files' settings
<!-- SomeProgram.exe.config -->
<configuration>
<connectionStrings configSource="externalConfig/connectionStrings.config"/>
</configuration>
<!-- externalConfig/connectionStrings.config -->
<connectionStrings>
<add name="conn" connectionString="blahblah" />
</connectionStrings>
Upvotes: 1
Reputation: 139256
You could put your app.config somewhere on a share and modify your winform application startup code, using the trick described on SO here: Change default app.config at runtime, something like this:
namespace WindowsFormsApplication1
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
using (AppConfig.Change(@"\\myserver\mypath\app.config"))
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
}
Upvotes: 3
Reputation: 1269
The following link talks about 3rd party tools you could use to synchronize files and folder
http://raywoodcockslatest.blogspot.com/2011/01/windows-7-raid-or-mirror-across.html
Also, have you tried writing your own replicator service. depending upon your time and budget you can make a decision to build or buy. I would perhaps build it.
Upvotes: 1