Amazon.com Widgets

Use of AppDomain.Load()

More from inside the walls..  From the dev that owns the loader...

AppDomain.Load() is only meant to be called on the current AppDomain (for use by Interop callers).  If you call it on a different AppDomain, if the assembly successfully loads in the target appdomain, it will then be loaded in the current appdomain, causing the FileNotFoundException for you.
If you need to execute an exe, you should use AppDomain.ExecuteAssembly() instead.  Otherwise, you should change to use Assembly.Load() from within the target appdomain.  To do that, create a type which extends MarshalByRefObject in the target appdomain, and call Assembly.Load() from a method in that type.  Be sure to not pass any types/assemblies (besides your MarshalByRefObject type) back to the original appdomain.  See http://www.gotdotnet.com/team/clr/AppdomainFAQ.aspx#_Toc514058497 for more info on how to do that.
 
Published 16 April 03 10:11 by BradA
Filed under:

Comments

# Laden von Assembly in eine AppDomain.... | hilpers said on January 20, 2009 9:35 AM:

PingBack from http://www.hilpers.com/293613-laden-von-assembly-in-eine

# Brad Abrams Use of AppDomain Load | Outdoor Ceiling Fans said on May 31, 2009 9:34 AM:

PingBack from http://outdoorceilingfansite.info/story.php?id=23579

# Brad Abrams Use of AppDomain Load | Outdoor Ceiling Fans said on May 31, 2009 11:36 AM:

PingBack from http://outdoorceilingfansite.info/story.php?id=5943

# Brad Abrams Use of AppDomain Load | patio cushions said on June 14, 2009 12:15 PM:

PingBack from http://patiocushionsource.info/story.php?id=1303

# Brad Abrams Use of AppDomain Load | porch swing said on June 19, 2009 3:30 AM:

PingBack from http://fancyporchswing.info/story.php?id=2153

New Comments to this post are disabled

Search

This Blog

Syndication

Page view tracker