Our web.config has this section:
<connectionStrings configSource="connections.config" />
Our connections.config looks (something) like this:
<connectionStrings>
<add name="conn" connectionString="Data Source=source;Initial Catalog=db;Trusted_connection=True" />
</connectionStrings>
I think the reason we do this is to make it easier for our clients to change the database configuration. But this means that connections.config
is checked into source control, and as a developer, I have to change it every time I am developing, and remember not to check those changes in.
As a result, I would like to use the configSource
attribute again in connections.config, something like this:
<connectionStrings configSource="connections.local.config">
<add name="conn" connectionString="Data Source=source;Initial Catalog=db;Trusted_connection=True" />
</connectionStrings>
But when I do this, I get the error:
Parser Error Message: Unrecognized attribute 'configSource'. Note that attribute names are case-sensitive.
Is it not possible to do this? It seems odd that the configSource attribute would only work in web.config itself.