Hi Joeseph:
The general approach is to work with 2 AppDomains - a "main" AppDomain
that loads and kicks off execution in a second "worker" domain that
can be unloaded when needed. This is essetially what ASP.NET is doing.
You can see some of this architecture outside of ASP.NET if you google
around for .NET plugin patterns. Many people write plugins to work in
a seperate AppDomain so that the plugin can be unloaded (individual
assemblies cannot be unloaded, so this is the only way to get a plugin
out of memory and unlock dlls).
--
Scott
http://www.OdeToCode.com/blogs/scott/
On Wed, 1 Jun 2005 23:03:15 +0100, "Joseph Farmer" <jo**@asdasd.com>
wrote:
Scott,
The problem with trying to unload the AppDomain using AppDomain.Unload is
that any code in the website which tries to do this will fail because it is
trying to unload itself. This is why I was trying to grasp how ASP.NET does
it - in case there is some other solution which I can hook into which means
I don't write code which tries to unload itself. Hope this is clear.
Joseph
"Scott Allen" <sc***@nospam.odetocode.com> wrote in message
news:lg********************************@4ax.com.. . Hi Joe:
The appdomain is not necessarily restarted, but there is a setting
called numRecompilesBeforeApprestart in the <compilation> section of
machine.config. Once the # of dynamic compiles exceeds this number
(the default is 15) the app domain will restart.
There are Load and Unload methods on the System.AppDomain class if you
want to experiment with AppDomains yourself.
--
Scott
http://www.OdeToCode.com/blogs/scott/
On Wed, 1 Jun 2005 16:01:27 +0100, "Joseph Farmer" <jo**@asdasd.com>
wrote:
Juan,
Ok, thanks - so once it detects that a file has changed how does it force
the application domain to be unloaded ?
Joseph
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:e1**************@tk2msftngp13.phx.gbl...
ASP.NET uses FileSystemWatcher to detect changes to system files:
http://msdn.microsoft.com/library/de...classtopic.asp
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
"Joseph Farmer" <jo**@asdasd.com> wrote in message
news:u%****************@TK2MSFTNGP15.phx.gbl...
>I would like to understand how ASP.NET 1.1 detects changes to aspx files
>and then forces an unload of the application domain (forcing a
>recompilation) - can anyone give me a clue as to where I can start
>looking
>?
>
> Joseph Farmer
>