HighTechTalks DotNet Forums  

Custom AppDomain and Remoting/Reflection question -- Is this possible?

Dotnet Framework (Remoting) microsoft.public.dotnet.framework.remoting


Discuss Custom AppDomain and Remoting/Reflection question -- Is this possible? in the Dotnet Framework (Remoting) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
roybrew@att.net
 
Posts: n/a

Default Custom AppDomain and Remoting/Reflection question -- Is this possible? - 06-01-2007 , 10:14 AM






I have a case in a web service (or any other app for that matter)
where I want to be able to load small assembly (console program) into
a custom AppDomain that I create (not the default AppDomain of the
calling app) and invoke a method. The reason being is that I want to
be able to unload the custom AppDomain when I am finished. I have
searched high and low for examples of how to do this. I've created a
proxy assembly in an attempt to handle the loading of the assembly and
prevent it from being loaded into the default AppDomain, but in every
case I have tried the console program I am loading into the custom
AppDomain also gets loaded into the default AppDomain of the calling
application.

Is there some way to load an assembly into another AppDomain so that
you can unload it at a later time?

For instance, in my application, if someone wanted to "update" this
console program that I am trying to load with a new version, I need to
use reflection to learn some information about the program so that I
can determine if it is the correct one to update. If I do all of the
reflection stuff (GetType, GetMethod, GetParameters, etc.), it loads
itself into the current AppDomain of the application and if I make an
attempt to delete the old console program, it is flagged as being in
use because the current AppDomain has it loaded. Again I have tried
to do this in a proxy object to prevent it from being loaded in the
default AppDomain and have it loaded into my custom AppDomain.

There seems to be very sparse information on this either in these .NET
newsgroups or the web. Any pointers would be greatly appreciated.
Thanks in advance.

Roy


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.