Re: Thank you and goodbye Mr Peter Morris



Danny Thorpe wrote:

It is a feature to ensure that when a block of code is removed from
memory, that there are no outstanding pointers to that code.
AppDomains exist to ensure dangling pointers don't.

Other than needing to declare class interfaces a certain way so that
they can be marshalled automatically across appdomain boundaries, I'm
not aware of any contortions required to make calls across the
appdomain boundary.

-Danny

Hi Danny,

The way I learned to do it, I had to create a proxy class that gets
created in the context of the app domain. This proxy class is
responsible for loading the assembly(s) and has methods that are used
to indirectly call assembly methods because even if I load an assembly
in a separate app domain, talking to it directly winds up loading it in
the current app domain, which, again, can't be unloaded.

If I want/need to unload an assembly, I need to unload the entire app
domain, so if I'm creating some kind of plug-in system, I either need
to unload and reload all of the plug-ins or use multiple app domains
for more granularity.

Compared to simply loading and unloading an assembly on demand, this is
more futzing around. I had a hard time finding clear documentation
when I first tried this, so that probably left a bad taste in my mouth.

If I'm going about this the hard way and you know an easier and/or more
direct way, please let me know. It wouldn't be the first time.

--
Regards,
Bruce McGee
Glooscap Software
.



Relevant Pages

  • Re: Restarting system serrvice that uses remoting.
    ... application always launches a 2nd App Domain to host your remote objects. ... When you want to unload remoting you can simply unload your App Domain, ... performing cleanup like you are doing prior to unloading the 2nd AppDomain ... > I hava a windows system service, that set its api as a .NET Remoting ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: Unloading appdomain and freeing memory
    ... the process ends, the memory is reclaimed. ... Once loaded into a particular app domain an assembly cannot be unloaded. ... plugin thing perhaps) and then unload the app domains when they weren't ... for anything loaded, even if you unload the appdomain, until the main ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Loading plugins in separate AppDomains
    ... Did the assembly load into the primary app domain or the secondary ... If the object copies to my primary appdomain but the assembly is still ... the attempt to unload the AppDomain appears to work. ... >>> In order for the plugin assemblies only to be loaded in the second ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How does ASP.NET check for changes to aspx files ?
    ... The problem with trying to unload the AppDomain using AppDomain.Unload is ... > the app domain will restart. ... >>> Juan T. Llibre ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Threads in AppDomain (Ingo please help ;-))
    ... I am already doing the very same thing, where I monitor all threads, ... being returned out of AppDomain, which is something I have to do. ... and the unload it as they go away. ... > Keep track of all the threads that you create, in a suitable collection. ...
    (microsoft.public.dotnet.framework.remoting)