prevent aspnet process to restart after web.config is changed

D

Daniel

Hi, is the a way to prevent aspnet process to restart after web.config is
modified?
like, waiting for all sessions to close, or not restart at all ?

Thank you,
Daniel
 
K

Kevin Spencer

Ms should learn from Apache...

Yeah, if MS could learn from Apache, they might end up the richest software
company in the world. Oh, wait a second.... they already ARE the richest
software company in the world.

Maybe Apache could learn something from Microsoft?

As for the question, the answer is, a programming platform is designed to be
used a certain way. The way ASP.Net is designed, a change to the web.config
file restarts the application. That is the way it should be used. IOW,
rather than hacking the platform, work with it the way it was designed to be
worked with. This goes for ANY programming platform. If you don't like it,
learn C, and write your own platform. ;-)

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
 
J

jongalloway

Daniel -

You can reference another file for your appSettings, and changes to
that file won't cause the app to restart.

Quote from Paul Wilson's post:
http://weblogs.asp.net/pwilson/archive/2003/04/09/5261.aspx

Web.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings file="YourSettings.config">
<add key="KeyToOverride" value="Original" />
<add key="KeyToNotOverride" value="Standard" />
</appSettings>
<system.web>
<!-- standard web settings go here -->
</system.web>
</configuration>

YourSettings.config:
<appSettings>
<add key="KeyToOverride" value="Overridden" />
<add key="KeyToBeAdded" value="EntirelyNew" />
</appSettings>

An added benefit is that you can have a dev.config, qa.config,
staging.config, prod.config, etc. Then your web.config holds your
config info that doesn't change between environments, and you can
easily version your environment specific config files.

The one trick there is that updates to the referenced config files
don't restart the app, so the config changes aren't picked up. You can
manually edit the web.config file or use my stupid "Touch" hack:
http://weblogs.asp.net/jgalloway/archive/2004/02/20/76866.aspx

You can roll your own configuration file and reader if you'd like to
have your changes picked up on the fly without restarting the aspnet
wp, but of course it would only be useful for your own custom
appSettings type info.

MSDN info:
http://msdn.microsoft.com/library/d...-us/cpgenref/html/gngrfAppSettingsElement.asp
- Jon
http://weblogs.asp.net/jgalloway
 
S

Saravana

If you are going to change only appsettings, then you can prevent aspnet
process to restart after .config file is changed. There is a option to
reference external config file in appsettings tag. In that custom config
file, you can have your appsettings. If you change that file it wont restart
the application. But this value will be picked when you restart your
application. For more details about this external config file check out this
blog,

http://dotnetjunkies.com/WebLog/saravana/archive/2004/10/28/30340.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top