D
donet programmer
I thought of using Settings.settings feature that is new to .NET for
storing connection strings info for TEST, INT and PROD regions.
Currently we prefix the appSettings keys with TEST, INT and PROD in
web.config (or app.config). For instance in my web.config I have
following keys:
<appSettings>
<add key="TEST.Connection" value = "......" />
<add key="INT.Connection" value = "......" />
<add key="PROD.Connection" value = "......" />
</appSettings>
When we deploy application to each region we set the value of server
variable ENVIRONMENT to "TEST", "INT" and "PROD".
We then use following to get conn string :
string connstring = [AppSettingsReader obj].GetValue( ENVIRONMENT +
".Connection")
This gives us TEST connection string in TEST region, INT conn string
in INT region etc.
I would like to do something similar with Settings.settings file. Any
ideas.
storing connection strings info for TEST, INT and PROD regions.
Currently we prefix the appSettings keys with TEST, INT and PROD in
web.config (or app.config). For instance in my web.config I have
following keys:
<appSettings>
<add key="TEST.Connection" value = "......" />
<add key="INT.Connection" value = "......" />
<add key="PROD.Connection" value = "......" />
</appSettings>
When we deploy application to each region we set the value of server
variable ENVIRONMENT to "TEST", "INT" and "PROD".
We then use following to get conn string :
string connstring = [AppSettingsReader obj].GetValue( ENVIRONMENT +
".Connection")
This gives us TEST connection string in TEST region, INT conn string
in INT region etc.
I would like to do something similar with Settings.settings file. Any
ideas.