473,857 Members | 2,117 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't delete webapp after creating app_offline.htm

I was under the impression that creating the app_offline.htm file at the
root of the webapp would cause all handles to be closed so that the app could
be removed. Unfortunately, this isn't the case. One handle remains open.

Debugging shows that it's actually the IIS cache and not ASP.NET that owns
this handle. During IIS shutdown, the handle is closed with the following
stack trace:
ChildEBP RetAddr
0006fbe4 5a403e05 kernel32!CloseH andle
0006fc04 5a4033ca W3CACHE!CDirMon itorEntry::Clea nup+0x52
0006fc14 5a4026b6 W3CACHE!CDirMon itorEntry::Rele ase+0x2e
0006fc1c 5a3aba23 W3CACHE!CACHE_E NTRY::~CACHE_EN TRY+0x17
0006fc28 5a401b9c w3core!UL_RESPO NSE_CACHE_ENTRY ::`vector deleting
destructor'+0xd
0006fc3c 5a40212e W3CACHE!CACHE_E NTRY::Dereferen ceCacheEntry+0x 2c
0006fc48 647187cd W3CACHE!CACHE_E NTRY_HASH::AddR efRecord+0x40
0006fc74 647188c2 IISUTIL!CLKRLin earHashTable::_ Clear+0x6f
0006fc84 5a40346b IISUTIL!CLKRHas hTable::Clear+0 x1f
0006fc90 5a3af52c W3CACHE!CACHE_M ANAGER::FlushAl lCaches+0x18
0006fca0 5a3b0167 w3core!W3_SERVE R::TerminateCac hes+0xc
0006fcb4 5a3bc26b w3core!W3_SERVE R::Terminate+0x ff
0006ff0c 0100187c w3core!UlW3Star t+0x280
0006ff44 01001a23 w3wp!wmain+0x22 a
0006ffc0 77e523cd w3wp!wmainCRTSt artup+0x12b
0006fff0 00000000 kernel32!BasePr ocessStart+0x23

Preventing remote access in the metabase sometimes causes the handle to be
closed:
ChildEBP RetAddr
017ff11c 5a403e05 kernel32!CloseH andle
017ff13c 5a4033ca W3CACHE!CDirMon itorEntry::Clea nup+0x52
017ff14c 5a4026b6 W3CACHE!CDirMon itorEntry::Rele ase+0x2e
017ff154 5a3aba23 W3CACHE!CACHE_E NTRY::~CACHE_EN TRY+0x17
017ff160 5a401b9c w3core!UL_RESPO NSE_CACHE_ENTRY ::`vector deleting
destructor'+0xd
017ff174 5a40212e W3CACHE!CACHE_E NTRY::Dereferen ceCacheEntry+0x 2c
017ff180 6470ff02 W3CACHE!CACHE_E NTRY_HASH::AddR efRecord+0x40
017ff1a0 6470ffaf IISUTIL!CLKRLin earHashTable::_ DeleteNode+0x1f
017ff1d8 6470fdf5 IISUTIL!CLKRLin earHashTable::_ DeleteIf+0xa5
017ff1fc 5a401f7f IISUTIL!CLKRHas hTable::DeleteI f+0x4c
017ff218 5a402f06
W3CACHE!CTypedH ashTable<CACHE_ HINT_HASH,CACHE _HINT_ENTRY,uns igned short
*,CLKRHashTable >::DeleteIf+0x2 b
017ff464 5a40350f W3CACHE!OBJECT_ CACHE::DoMetada taInvalidationF lush+0x5e
017ff474 5a403948 W3CACHE!CACHE_M ANAGER::HandleM etadataInvalida tion+0x2d
017ff480 5a3c32a6 W3CACHE!W3Cache DoMetadataInval idation+0x24
017ff4a0 5a3b1839 w3core!W3_SITE: :HandleMetabase Change+0x92
017ff53c 5a3b1b37 w3core!W3_SERVE R::HandleMetaba seChange+0x8c
017ff558 5a3b1bb7 w3core!W3_SERVE R::MetabaseChan geNotification+ 0x62
017ff568 6471f6ed w3core!MB_LISTE NER::Synchroniz edSinkNotify+0x 16
017ff588 77c70f3b IISUTIL!MB_BASE _NOTIFICATION_S INK::SinkNotify +0x39
017ff5a8 77ce23f7 RPCRT4!Invoke+0 x30

What is the best, reliable way to make IIS release this handle? An older
version of the webapp that ran in ASP.NET 1.1 had a FileSystemWatch er that
unloaded the AppDomain when a certain file was created. This worked but I
can't find out which change between the two caused the change in behaviour.
Nov 28 '05 #1
5 3509
Hi Sam,

Welcome to ASPNET newsgroup.
Regarding on the can not delete webapp problem you mentioned, I' m not
quite sure about the "handle" yo mentioned, is it your custom Httphandler
components or any other file handle or assembly that is locked by the IIS
so that you can not remove? Generally the aspx page files will not be
opened as exclusive ,also the private bin assemblies will be shadow copied
to temp dir without any locking issue... Is the items being locked used in
your application through some particular means?

Also, for App_offline.htm file, it is generated file used by VS.NET IDE
when copying site , this file can only prevent any sequential request to
the web application(whe re the app_offline.htm is put) be redirect to the
offline.htm so as to prevent runtime processing any further request during
the copying website....... So I don't think it'll help release any
resource which is being used already...

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Thread-Topic: Can't delete webapp after creating app_offline.htm
| thread-index: AcX0LoRC8cgVFrW iSOivg93WgQv11Q ==
| X-WBNR-Posting-Host: 32.112.128.18
| From: =?Utf-8?B?U2FtNzc3?= <sa****@nospam. nospam>
| Subject: Can't delete webapp after creating app_offline.htm
| Date: Mon, 28 Nov 2005 07:15:07 -0800
| Lines: 57
| Message-ID: <A9************ *************** *******@microso ft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA01.phx.gbl!T K2MSFTNGXA03.ph x.gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3612 56
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| I was under the impression that creating the app_offline.htm file at the
| root of the webapp would cause all handles to be closed so that the app
could
| be removed. Unfortunately, this isn't the case. One handle remains open.
|
| Debugging shows that it's actually the IIS cache and not ASP.NET that
owns
| this handle. During IIS shutdown, the handle is closed with the
following
| stack trace:
| ChildEBP RetAddr
| 0006fbe4 5a403e05 kernel32!CloseH andle
| 0006fc04 5a4033ca W3CACHE!CDirMon itorEntry::Clea nup+0x52
| 0006fc14 5a4026b6 W3CACHE!CDirMon itorEntry::Rele ase+0x2e
| 0006fc1c 5a3aba23 W3CACHE!CACHE_E NTRY::~CACHE_EN TRY+0x17
| 0006fc28 5a401b9c w3core!UL_RESPO NSE_CACHE_ENTRY ::`vector deleting
| destructor'+0xd
| 0006fc3c 5a40212e W3CACHE!CACHE_E NTRY::Dereferen ceCacheEntry+0x 2c
| 0006fc48 647187cd W3CACHE!CACHE_E NTRY_HASH::AddR efRecord+0x40
| 0006fc74 647188c2 IISUTIL!CLKRLin earHashTable::_ Clear+0x6f
| 0006fc84 5a40346b IISUTIL!CLKRHas hTable::Clear+0 x1f
| 0006fc90 5a3af52c W3CACHE!CACHE_M ANAGER::FlushAl lCaches+0x18
| 0006fca0 5a3b0167 w3core!W3_SERVE R::TerminateCac hes+0xc
| 0006fcb4 5a3bc26b w3core!W3_SERVE R::Terminate+0x ff
| 0006ff0c 0100187c w3core!UlW3Star t+0x280
| 0006ff44 01001a23 w3wp!wmain+0x22 a
| 0006ffc0 77e523cd w3wp!wmainCRTSt artup+0x12b
| 0006fff0 00000000 kernel32!BasePr ocessStart+0x23
|
| Preventing remote access in the metabase sometimes causes the handle to
be
| closed:
| ChildEBP RetAddr
| 017ff11c 5a403e05 kernel32!CloseH andle
| 017ff13c 5a4033ca W3CACHE!CDirMon itorEntry::Clea nup+0x52
| 017ff14c 5a4026b6 W3CACHE!CDirMon itorEntry::Rele ase+0x2e
| 017ff154 5a3aba23 W3CACHE!CACHE_E NTRY::~CACHE_EN TRY+0x17
| 017ff160 5a401b9c w3core!UL_RESPO NSE_CACHE_ENTRY ::`vector deleting
| destructor'+0xd
| 017ff174 5a40212e W3CACHE!CACHE_E NTRY::Dereferen ceCacheEntry+0x 2c
| 017ff180 6470ff02 W3CACHE!CACHE_E NTRY_HASH::AddR efRecord+0x40
| 017ff1a0 6470ffaf IISUTIL!CLKRLin earHashTable::_ DeleteNode+0x1f
| 017ff1d8 6470fdf5 IISUTIL!CLKRLin earHashTable::_ DeleteIf+0xa5
| 017ff1fc 5a401f7f IISUTIL!CLKRHas hTable::DeleteI f+0x4c
| 017ff218 5a402f06
| W3CACHE!CTypedH ashTable<CACHE_ HINT_HASH,CACHE _HINT_ENTRY,uns igned short
| *,CLKRHashTable >::DeleteIf+0x2 b
| 017ff464 5a40350f W3CACHE!OBJECT_ CACHE::DoMetada taInvalidationF lush+0x5e
| 017ff474 5a403948 W3CACHE!CACHE_M ANAGER::HandleM etadataInvalida tion+0x2d
| 017ff480 5a3c32a6 W3CACHE!W3Cache DoMetadataInval idation+0x24
| 017ff4a0 5a3b1839 w3core!W3_SITE: :HandleMetabase Change+0x92
| 017ff53c 5a3b1b37 w3core!W3_SERVE R::HandleMetaba seChange+0x8c
| 017ff558 5a3b1bb7 w3core!W3_SERVE R::MetabaseChan geNotification+ 0x62
| 017ff568 6471f6ed w3core!MB_LISTE NER::Synchroniz edSinkNotify+0x 16
| 017ff588 77c70f3b IISUTIL!MB_BASE _NOTIFICATION_S INK::SinkNotify +0x39
| 017ff5a8 77ce23f7 RPCRT4!Invoke+0 x30
|
| What is the best, reliable way to make IIS release this handle? An older
| version of the webapp that ran in ASP.NET 1.1 had a FileSystemWatch er
that
| unloaded the AppDomain when a certain file was created. This worked but
I
| can't find out which change between the two caused the change in
behaviour.
|

Nov 29 '05 #2
Hi.
Regarding on the can not delete webapp problem you mentioned, I' m not
quite sure about the "handle" yo mentioned, is it your custom Httphandler
components or any other file handle or assembly that is locked by the IIS
so that you can not remove?
It's a native file handle open on the root directory of the webapp e.g.
c:\inetpub\wwwr oot\webapp. This prevents us from deleting the directory
which means our uninstaller has to warn the user that they have to manually
remove files which is pretty ugly.

Generally the aspx page files will not be
opened as exclusive ,also the private bin assemblies will be shadow copied
to temp dir without any locking issue... Is the items being locked used in
your application through some particular means?
Our webapp is 100% managed code and the app domain has been shutdown (by
app_offline.htm ) so I can't see how our code could be locking anything.

Also, for App_offline.htm file, it is generated file used by VS.NET IDE
when copying site , this file can only prevent any sequential request to
the web application(whe re the app_offline.htm is put) be redirect to the
offline.htm so as to prevent runtime processing any further request during
the copying website....... So I don't think it'll help release any
resource which is being used already...


Our uninstaller is generating the file - Visual Studio is not involved.
Scott says that the file should remove locks so that maintenance can be
performed - http://weblogs.asp.net/scottgu/archi...06/426755.aspx

Do you know what logic is used to determine whether the
w3core!W3_SERVE R::MetabaseChan geNotification function is called when the
metabase is updated e.g. denying access to pages?

Thanks,
Sam.
Nov 29 '05 #3
Hi Sam,

Thanks for your response.
Since the application is hosted in IIS, the IIS's virtual dir is controled
by IIS manager so I think it is possible that some certain native handle is
held by the IIS to reference the virutal dir. Also, the app_offline.htm is
used for VS.NET IDE to make aspnet request stop being processed by asp.net
runtime, no document about it'll have effect on the IIS's management on the
virtual dir's physical folder..... Generally for deleting application
virtual directory, we're recommended to use the IIS's metabase interfaces
such as ADSI to remove th virtual directory instead of directly deleting
physical directory....

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| Thread-Topic: Can't delete webapp after creating app_offline.htm
| thread-index: AcX04MKUu6jqAcI pS3exc+oZod/kAQ==
| X-WBNR-Posting-Host: 32.112.128.18
| From: =?Utf-8?B?U2FtNzc3?= <sa****@nospam. nospam>
| References: <A9************ *************** *******@microso ft.com>
<eh************ **@TK2MSFTNGXA0 2.phx.gbl>
| Subject: RE: Can't delete webapp after creating app_offline.htm
| Date: Tue, 29 Nov 2005 04:31:02 -0800
| Lines: 39
| Message-ID: <67************ *************** *******@microso ft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGXA03.phx .gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3614 52
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| Hi.
|
| > Regarding on the can not delete webapp problem you mentioned, I' m not
| > quite sure about the "handle" yo mentioned, is it your custom
Httphandler
| > components or any other file handle or assembly that is locked by the
IIS
| > so that you can not remove?
|
| It's a native file handle open on the root directory of the webapp e.g.
| c:\inetpub\wwwr oot\webapp. This prevents us from deleting the directory
| which means our uninstaller has to warn the user that they have to
manually
| remove files which is pretty ugly.
|
|
| > Generally the aspx page files will not be
| > opened as exclusive ,also the private bin assemblies will be shadow
copied
| > to temp dir without any locking issue... Is the items being locked
used in
| > your application through some particular means?
|
| Our webapp is 100% managed code and the app domain has been shutdown (by
| app_offline.htm ) so I can't see how our code could be locking anything.
|
|
| > Also, for App_offline.htm file, it is generated file used by VS.NET
IDE
| > when copying site , this file can only prevent any sequential request
to
| > the web application(whe re the app_offline.htm is put) be redirect to
the
| > offline.htm so as to prevent runtime processing any further request
during
| > the copying website....... So I don't think it'll help release any
| > resource which is being used already...
|
| Our uninstaller is generating the file - Visual Studio is not involved.
| Scott says that the file should remove locks so that maintenance can be
| performed - http://weblogs.asp.net/scottgu/archi...06/426755.aspx
|
| Do you know what logic is used to determine whether the
| w3core!W3_SERVE R::MetabaseChan geNotification function is called when the
| metabase is updated e.g. denying access to pages?
|
| Thanks,
| Sam.
|

Nov 30 '05 #4
We've decided to stop investigating this and just shutdown the app pool prior
to uninstallation.

Thanks,
Sam.
Dec 2 '05 #5
Actually, we've seen a bit of this problem. When we use VS IDE to Publish a
Website using FTP, the app_offline.htm is not deleted after the successful
publish. When we try to remove it using FTP console, we see Access denied,
probably because IIS still has the file opened. Attempts to delete the file
using a local console also fail, AccessDenied.

--
Senior Developer
"Sam777" wrote:
We've decided to stop investigating this and just shutdown the app pool prior
to uninstallation.

Thanks,
Sam.

Dec 5 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1696
by: Zhang Weiwu | last post by:
Hello. We recently designed a webapp and because most HQ staff use FF, we designed it based on FF. Now we extend this webapp to allow sub-offices in other cities to use the webapp, they use IE, and the look is terrible, CSS positions are very wrong. I can find all the difference between IE and mozilla and correct every positioning by providing two stylesheets for Mozilla and IE. But this is a lot of work. I wonder if there are existing...
5
4681
by: Raghu Raman | last post by:
Hi, I want to run the calculator.exe file from my c# webapp.I did this by using the hyperlink control and the location of the exe is the navigate url and is working nice. But it gives the dialog box telling ,'one or more files can harm your computer ...' since it is opening on the IE. if i click the open button the calc.exe is opened.
12
3186
by: Mats Lycken | last post by:
Hi, I'm creating a CMS that I would like to be plug-in based with different plugins handling different kinds of content. What I really want is to be able to load/unload plugins on the fly without restarting the application. What I did was to create an AppDomain that loaded the plugins and everything was great, until I tried to pass something else that strings between the domains...
2
2722
by: fhtino | last post by:
App_offline.htm is a very usefull feature during web site updates. But I don't understand why asp.net engine returns a 404 status code instead of a "normal" 200. I created a simple app_offline file: <html> <body> Apllication off line! </body> </html>
0
1197
by: Marc Scheuner | last post by:
Folks, I'm facing some problems with the cool new "app_offline.htm" feature in ASP.NET 2.0. My web app is being bundled up into an .MSI and installed by executing that MSI - works nicely. My virtual directory has been created manually, before the app's installation. Now I was hoping to be able to just drop in an "app_offline.htm" file
2
2029
by: Victor Rodriguez | last post by:
Is there a way to have a custom app_offline file when publishing a website from .NET 2005? thanks, Victor
0
1481
by: raghav | last post by:
Hi Friends I have a question. I work throughtout the day with my application (C#.NET, ASP.NET 2.0, SQL SERVER 2005 ). By end of the day if I see my Recycle Bin full of app_offline files. Then everyday I remove these files from recycle bin. I want to know that is it normal? or something is wrong? I am asking because it should not create any problem in future.... Regards Raghav Mahajan
5
2400
by: Olivier GIL | last post by:
Hello, The method Directory.Delete(path, true) of .NET 2.0 called from within a web app does not work correctly if the initial directory is not empty : all the files inside the root directory and subdirectories are actually deleted, but the leaf subdirectories in the tree remain "locked" (they are not accessible anymore by the webapp or by Windows Explorer) until the webapp ends. When the web app is ended, the leaf subdirectories...
2
1576
by: Larry Rebich | last post by:
App_Offline.htm DOES take the site down. Good. App_Offline.htm's message is not displayed. Bad I'm getting a generic 404 message rather than the App_Offline message - which contains a 'maintenance being performed, please try later' message. Is there some way to get Asp.Net to display the App_Offline message rather than the generic 404 message?
0
9923
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9767
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11082
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10807
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9549
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7939
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7104
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5967
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4592
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.