Chris
Chris

Reputation: 8442

Application Restart when custom configuration file changes

I just wanted to check as I can't find the answer on Google. If a custom config file in my application root is changed during run time, the app won't restart right? .NET is only watching over web.config right?

Upvotes: 3

Views: 1672

Answers (2)

Adam
Adam

Reputation: 3665

Found a good resource that seems to explain what cause an automatic reset. It really depends on some of the particulars in your case.

http://blogs.msdn.com/b/johan/archive/2007/05/16/common-reasons-why-your-application-pool-may-unexpectedly-recycle.aspx

Altering the following files will also trigger an immediate restart of the application pool:

  • web.config
  • machine.config
  • global.asax
  • Anything in the bin directory or it's sub-directories

Upvotes: 1

Mohammed Swillam
Mohammed Swillam

Reputation: 9242

by default, the website will restart if you changed your custom config files that are being references inside your web.config file, but to overcome this behavior is an easy thing. You will need to change the attribute "restartOnExternalChanges" to false in your machine.config file.

See: http://msdn.microsoft.com/en-us/library/ms228057.aspx

also note that if you modifies files under your bin folder, the application will restart.

Upvotes: 1

Related Questions