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.


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): 14991

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"/> 

           <smtp configSource="mail.config"/>

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:

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

  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