PC Review


Reply
Thread Tools Rate Thread

AppDomain / Object Lifetime & AppDomain.Unload

 
 
=?Utf-8?B?QXJ0aHVyIE0u?=
Guest
Posts: n/a
 
      12th Jul 2005
If anyone could land me a hand here, would be much appreciated.

Application is using Interface based plugin system.

Load Steps:
Initialize loader class -> Create App Domain -> Load Assembly -> Get an
instance of a class and return well-defined interface back to the caller

When underlying assembly is changed, the change is detected new app domain
is created and requests for new objects will be executed on the new domain.
The part that I'm uncertain about:
What happens with objects already created? Obviously the reference to a
proxy object still exists, is application domain going to exist until the
time all references to it are gone or proxy objects will end up pointing into
the void?

Also, what happens in the same scenario but when AppDomain.Unload is called?

All processing is being done on the same system.

thanks, in advance.



 
Reply With Quote
 
 
 
 
=?Utf-8?B?QXJ0aHVyIE0u?=
Guest
Posts: n/a
 
      12th Jul 2005
Based on a few experiments -
When a function on a proxy pointing to an unloaded domain is executed,
application "quits" (interesting how IDE trapped no exceptions)

When a function on a proxy pointing to a loaded but abandoned domain is
executed
(i.e. AppDomain object which is not referenced from anywhere other then a
proxy object & real object residing within) everything continues to function.

These experements brought up another question - if setting an infinite lease
time on a remote object will prevent GC from collecting it, then how is it
possible to trigger destruction of an infinite lease object? Does anyone know
an answer?

"Arthur M." wrote:

> If anyone could land me a hand here, would be much appreciated.
>
> Application is using Interface based plugin system.
>
> Load Steps:
> Initialize loader class -> Create App Domain -> Load Assembly -> Get an
> instance of a class and return well-defined interface back to the caller
>
> When underlying assembly is changed, the change is detected new app domain
> is created and requests for new objects will be executed on the new domain.
> The part that I'm uncertain about:
> What happens with objects already created? Obviously the reference to a
> proxy object still exists, is application domain going to exist until the
> time all references to it are gone or proxy objects will end up pointing into
> the void?
>
> Also, what happens in the same scenario but when AppDomain.Unload is called?
>
> All processing is being done on the same system.
>
> thanks, in advance.
>
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET 3.5 AppDomain Lifetime Options Prasanna P Microsoft ASP .NET 1 26th Feb 2009 10:57 PM
AppDomain.Unload John Wood Microsoft C# .NET 4 12th Oct 2004 12:36 AM
unload assembly - AppDomain.Unload does not work as expected =?Utf-8?B?RGllcmsgRHJvdGg=?= Microsoft Dot NET Framework 2 4th Apr 2004 04:06 PM
Repost: Isolation In AppDomain - How to prevent the main AppDomain to crash when another AppDomain Crashes?????? José Joye Microsoft C# .NET 7 6th Nov 2003 02:10 PM
Repost: Isolation In AppDomain - How to prevent the main AppDomain to crash when another AppDomain Crashes?????? José Joye Microsoft Dot NET 7 6th Nov 2003 02:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:48 PM.