简体   繁体   中英

Restarting IIS on file changed

AFAIK IIS restarts, whenever any of the web.config files is changed.
I've created my own configuration files (my.config, with slightly different hierarchy). Is there any possibility to have IIS automatically (automagically :)) restarted, whenever any of these are changed, too?

EDIT: I've considered filesystem watchers, but I'm not sure where to put them.

You mean to say that whenever you change my.config iis has to be restarted automatically.

Maybe you can write a batch file to perform your iisreset functinality alone if you dont want the user to manually restart IIS. But even if you give a batch file the user still needs to execute.

quick and ugly fix would be put config files in bin directory.

btw. I don't believe I am writing this ;)

these changes restarts web app:

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

copy/pasted from here Common reasons why your application pool may unexpectedly recycle

Use SomeAssemly.dll.config which will be put into ~/Bin , automatic be read on app (re)start and cause app restart on edit.

Note that App.config in project becomes $(OutputAssembly).config on build

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM