Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Separate ConnectionStrings and mailSettings from web.config? Possible?

Is it possible to separate ConnectionStrings and mailSettings from web.config?

Devel environment has different IP addresses for connectionstrings and smtp mails because of development and testing. We dont want to do tests and devel using live machines and live IP addresses.

Is it possible?

like image 344
feronovak Avatar asked Jul 05 '11 12:07

feronovak


1 Answers

I found the answer on MSDN:

<configuration>
    <connectionStrings configSource="connections.config"/> 
</configuration>

With file connections.config containing

<connectionStrings>
   <add name="name" connectionString="conn_string" providerName="System.Data.SqlClient" />
   <add name="name2" connectionString="conn_string2" providerName="System.Data.SqlClient" />
</connectionStrings>
like image 153
feronovak Avatar answered Oct 19 '22 22:10

feronovak