Senator Guerra Souty original series calendar,replica hublot blue steel peach pointer collocation of rolex replica Rome digital scale, track type minute replica watches scale shows that the classical model is swiss replica watches incomparable, wearing elegant dress highlights.
mr-ponna.com

 

YOU ARE HERE: HOME Questions How to change website configuration without restarting ASP NET application



Change website configuration without restarting ASP.NET application

View(s): 15017

How to change website configuration without restarting ASP.NET application

Answer 1)

Any change in Web.config file will cause ASP.NET application to restart. But, it is possible to create one or more external .config files which don't cause application restart. To connect external .config files with main Web.config, use configSource parameter. Here is an example code snippet, used to read external configuration from three files:

<connectionStrings configSource="db.config"/>
   <appSettings configSource="app.config"/> 

   <system.net>
       <mailSettings>
           <smtp configSource="mail.config"/>
       </mailSettings>
   </system.net>

So, in this example, we can change connection strings, application settings and mail settings. Application will not restart when any of these files change. Any external .config file should contain only section where is called. For example, db.config is called from <connectionStrings /> and should contain only connection strings, like this:

<connectionStrings>
     <clear />
     <add name="ConnStringName" connectionString="Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;" providerName="Syste.Data.SqlClient"/>
</connectionStrings>


  Asked in:  SemanticSpace Technologies   Expertise Level:  Experienced
  Last updated on Monday, 03 December 2012
4/5 stars (11 vote(s))

Register Login Ask Us Write to Us Help