Dear Radek...
First of all thanks for your Help/Ideas...
As i had to accept that there was no way to change the Connection Strings name, Radek pointet me out a good iead for my problem.
This was my question to Radek:
Well our goal is the following:
We are starting to use TFS…
Imagine you have Dev-Staging-Live environment.
If someone is working on dev and has settings to do in web.config, then he does the changes he has to do and checks it in.
On the day before GoLive we Merge all the changesets that are defined to go live to Staging. And here ist he problem… if in the Changeset the Web.Config file is, then the ConnectionString from the Development environment would also get merged…
If we could outsource them by a name (which i think would not be a big problem in the installation phase of the project), then we could create a DevConnectionsStrings.config a StagingConnectionStrings.config and a LiveConnectionStrings.config file and deploy them on the servers… and nobody would have to bother about connection strings anymore…
And his answer made me rethink:
Radeks Partial Answer:
In this case, you could use inheriting the web.config files in a way, that the web.config will be defined in web site’s root and particular applications will inherit it, like:
/inetpub/wwwroot/web.config with connectionString
/inetpub/wwwroot/app/web.config – without connectionString and /clear element.
And my Final Solution will be that i will Create a ConnectionFile for each CMS.
As en example:
My CMS Customer is Called
Foo.
I am going to create a
FooConnectionString.config File laying in the folder:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG
containing:
<connectionStrings>
<add name="CMSConnectionString" connectionString="Persist Security Info=False;database=Foo;server=SERVER;user id=USER;password=PASSWORd;Current Language=English;Connection Timeout=240;" />
</connectionStrings>
And in the Web.Config i just set the
<ConnectionStrings configSource ="C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\FooConnectionString.config" />
And the magic is if on the Staging and Prod servers the same files are laying then no one has to bother about connection strings on the desired environments anymore...
Hope i could help anyone...
Regards
Patrick