As far as I understand, IIS-hosted applications can stop or restart for a variety of reasons, including:
- A person explicitly telling it to using the stop button in IIS manager.
- Automatically restarting an application for one of various reasons. (In particular, when a the application's physical path is changed in IIS.)
When this happens, does it do so gracefully or forcefully?
By gracefully, I mean without stopping the application in the middle of processing a request; it should finish what it's doing and then follow its normal shut down procedures for the application.
IIS will attempt to allow workers to finish, but will forcefully terminate them if they take too long to stop (usually a few seconds). To get around this, you can use
iisreset /noforce
to make IIS wait until everything is done.