Can you modify the web.config and NOT restart the ASP.NET application? [duplicate]
Asked Answered
R

4

7

Possible Duplicate:
How to prevent an ASP.NET application restarting when the web.config is modified?

Was just thinking about uptime. Thanks.

Rakia answered 28/1, 2010 at 14:26 Comment(3)
Perhaps the setting stored there should be moved somewhere else if uptime is your concern. What is it you're changing? Does it have to be in web.config?Augment
VTC for duplication. See #614324Alephnull
There are more things to consider than just the asp.net application restarting when changing you web.config on the fly...Flute
A
14

Yes, you can; see this answer.

However, it is not a good idea.
Until ASP.Net restarts the AppDomain, it will not look at web.config.
If you change web.config, your changes will have no effect until the AppDomain is restarted.

Absorptance answered 28/1, 2010 at 14:30 Comment(0)
C
10

You can create an external settings file and then reference it in your web.config. 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

Cannabis answered 28/1, 2010 at 15:16 Comment(0)
D
1

You can setup a duplicate IIS container on a different ip address / hostname. Make your modification to the new version and then swap the ip's over. It gets rid of the compile time of the application restart. However, if you rely on in-proc session it'll all go wrong for any current users anyway.

Safest option is to allow it to restart and just pick a good time to do it. You can also set compilation batch = false. This can also speed up the compile time in critical systems.

Davinadavine answered 28/1, 2010 at 14:31 Comment(0)
F
0

The application pool will reset when you modify the wed.config and you will lose any session information stored on the server.

Flute answered 28/1, 2010 at 14:29 Comment(1)
@downvoter: Umm ok..so you don't think the resetting the application pool is a bad thing?Flute

© 2022 - 2024 — McMap. All rights reserved.