[thelist] ASP - Application never unloads

Atkins, Chris CAtkins at patriothomes.com
Thu Jun 1 17:04:44 2000


Hehe... *ahem* I made yet another assumption...
I think we all know that "assume" makes an "ass"
out of "u" and "me".  Oops, another assumption. :)

Anyway, my self-proposed _solution_ works very well--
on IIS *5* (ASP 3.0)...  blech.  NT4 here at the shop,
so no go....

But... I came up with a different way around it.

Made a batch file, ssiis.bat (start/stop iis), that contained:

----begin ssiis.bat---
@echo off
net stop iisadmin /y
net start w3svc /y
---end ssiis.bat---


Then I scheduled it to run night at 2am:
 at 2:00am /every:m,t,w,th,f "c:\ssiis.bat"

Notes:  Stopping the iisadmin service also stops the w3svc, and starting
the w3svc also starts the iisadmin service.  Together they represent
inetinfo
on IIS4. More info:
http://support.microsoft.com/support/kb/articles/Q185/3/82.ASP

You can get the syntax of the "at" command by typing "at /?" in DOS.

I wrote:
> So here is how I'm going to solve my problem.  
> 
> Sub Session_OnStart
> 	Application.Lock
> 		Application("numUsers") = Application("numUsers") + 1
> 	Application.Unlock
> End Sub
> 
> Sub Session_OnEnd
> 	Application.Lock
> 		Application("numUsers") = Application("numUsers") - 1
> 	Application.Unlock
> 	if Application("numUsers") < 1 then
> 		Application.Contents.RemoveAll() 'This was the bit you
> referred to
> 	end if
> End Sub
> 
> Sub Application_OnStart
> 	Application("numUsers") = 0
> End Sub