First off, let me start by saying that I'm talking about a development server here. So with all due respect, please refrain from any "you shouldn't do that to your customers"-type of answers or comments. It is duly noted, and I never would.
According to this web article, it should never be necessary to reset/restart (is there a difference?) an IIS server for configuration changes to take hold:
IIS 7.0+ is designed to automatically pick up configuration changes. This happens whenever you deploy a new website, change website bindings, or modify any other server-level configuration. IIS automatically applies your changes to:
- Web.config (application level): IIS triggers a restart of the affected application.
The section I'm talking about actually includes a table instead of a bullet list, and goes through all the different possible config. changes and what IIS does when they happen. However, I find their supposition about the type of change mentioned to be an absolute load of poppy cock IME (at least on a dev server).
It is often the case that while developing, I will change something in my app's Web.config and make a typo, or just blatantly get it wrong, and all of a sudden IIS falls over. Every attempt to correct the mistake will result in a <30 ms page reload time, and the exact same ASP.NET error page. So my "rusty hammer" (as those people call it) is the iisreset
command.
But as they mention further up and in this related article, it is an ancient and (usually) excessive tool for the job that can supposedly be done by application pool recycling:
Bottom line: It is never necessary to use IISRESET to pick up configuration changes. For complete details on this, see the Make sure IIS has picked up the website, application pool, or configuration changes section in the reset, restart, and recycle IIS guide.
And that last sentence links back to the first article. But app pool recycling never works for me in the specific scenario that I've described!
So I completely understand the explanation of why it's bad, and don't want to use iisreset
anymore, but I feel as though I have no choice. Is this true, or is there a better command that I could be using?
PS: I've read Access denied trying to run IISReset logged in as a local aministrator and Brondahl's answer to it, and that's what actually led me to the two articles above. So I'm tempted to use the workaround that they all mention, but after reading the history of iisreset
and why it should probably be removed IMHO, I would really rather something succinct and not excessive.