How to stop a malfunctioned web application?

If you are a Windows Server Administrator and notice an ASP.NET web application is malfunctioning, then how will you stop this application?

Answer: Just delete the application from the server. Just kidding. πŸ™‚

Real answer:

Open up the web.config file of the web application, then change httpRuntime to false. Like this:

<httpRuntime enabled=”false” />

Don’t forget to save the change. The modification of web.config will cause the application to restart, but because httpRuntime is false, the application will stop then. A “resource cannot be found” error page will show up if user tries to access the web application:

However, the above error page may confuse user. what you can do then is to create a offline notification file called app_offline.htm and put it in your web application’s directory. All future request for the web application will be automatically redirect to app_offline.htm page.

Remember, it only works for .NET 2.0 or higher. Although MSDN web site mentions that the “enable” attribute “Specifies whether the App Domain is enabled” at the current node and at the child node level. and the default value is true“, it actually only works in .NET 2.0 or higher. If you put enable=”true” in .NET 1.1 web application, Β it will cause a configuration error like this:

Leave a Reply

Notify of
Close Bitnami banner