在调试asp.net 2.0开发的Web Application后,发现我的回收站里有很多App_Offline.htm文件。Google了一下,在ScottGu's Blog上找到了对App_Offline.htm的解释。App_Offline.htm

上面提到,App_Offline.htm是Asp.net的一个新特性。在你想暂停你的Web Application时(例如升级,在升级的过程中,你不希望别人访问你的站点内容),你可以在Web Application的跟目录中,放一个App_Offline.htm文件,这样,对站点的所有访问请求,都会被转到App_Offline.htm上。


I was planning to break the news about the little-heard-of app_offline.htm feature in ASP.NET 2.0, but Erik beat me to it.

 

Basically, if you place a file with this name in the root of a web application directory, ASP.NET 2.0 will shut-down the application, unload the application domain from the server, and stop processing any new incoming requests for that application. ASP.NET will also then respond to all requests for dynamic pages in the application by sending back the content of the app_offline.htm file (for example: you might want to have a “site under construction” or “down for maintenance” message).

 

This provides a convenient way to take down your application while you are making big changes or copying in lots of new page functionality (and you want to avoid the annoying problem of people hitting and activating your site in the middle of a content update). It can also be a useful way to immediately unlock and unload a SQL Express or Access database whose .mdf or .mdb data files are residing in the /app_data directory.

 

Once you remove the app_offline.htm file, the next request into the application will cause ASP.NET to load the application and app-domain again, and life will continue along as normal.

 

Hope this helps,



但是,我还是有点不明白,为什么在我开发的过程中,会为我自动创建这个文件,并且又自动放入回收站
posted on 2007-01-08 08:44  scdsun  阅读(691)  评论(0编辑  收藏  举报