If the lifetime of the object is that of the application's lifetime, then you don't need to call dispose as the framework will
invoke the finalizers for these objects before the AppDomain is unloaded. In other words, if the app is ending then you don't have
to clean up managed resources. They are managed, and the framework does it for you.
Unless it's a custom object that needs to release unmanaged resources. Then you can do this in the Application_End event as you've
specified.
If the lifetime of the object is that of a user's session, Session_End should be used to dispose of the object. I'm not sure, but
I'd imagine that if the application is ending, all sessions will have time to cleanup via the Session_End event as well but this is
just an assumption
--
Dave Sexton
dave@www..jwaonline..com
-----------------------------------------------------------------------
"Craig" <mc******@mtn.co.za> wrote in message news:%2****************@TK2MSFTNGP14.phx.gbl...
Hi,
I'm having difficulty understanding how the Application_End event in the Global.asax file gets called. I thought that it's called
when the specific web site is stopped via the IIS management console. Could anyone please tell me where I can dispose of objects
when wanting to stop a specific web site without having to explicitly run IISRESET, as I have other web sites that I am not
allowed to reset on the same machine and calling IISRESET will reset them.
Thanks you.
Regards,
Craig