Separate ConnectionStrings and mailSettings from web.config? Possible?

后端 未结 1 984
半阙折子戏
半阙折子戏 2021-02-14 17:41

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

Devel environment has different IP addresses for connectionstrings and smtp mails because

相关标签:
1条回答
  • 2021-02-14 18:07

    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>
    
    0 讨论(0)
提交回复
热议问题