Kiruthik Speaks on ......

 Thursday, January 11, 2007

Taking your ASP.Net Web Application Offline

My work mostly revolves around ASP.Net based Projects, and so I frequently come across a situation where I release the application (or a part of it - may be dll ) for Testing, when someone is accessing. Generally I used to delete the web folder and install the new one after a informal notification. For this I cant stop or pause the Web server, as some other web application is running side by side will get affected. In times, I will just replace the web folder as such (taking advantage of the xcopy deployment). Its not the exact way to do so!!

At last I found the solution for this : Simply add a file called app_offline.htm to your root of the web folder. The application wont respond to any of the further requests. It just throws  404 - Error ( The resource cannot be found. )

app_offline.htm  - can be a empty file. This is a simple way to bring your application Offline!

To bring it back (making it online is so simple - deleting the file app_offline.htm will do!

I have checked with ASP.Net 2.0, and not tried with ASP.Net 1.1 Even I dont know whether this feature is there in ASP.Net 1.1

[Source]

1/11/2007 5:24:42 AM UTC  #    Disclaimer  |  Comments [4]