Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Load updated assembly dynamically in new appdomain

9 views
Skip to first unread message

oenren

unread,
Dec 2, 2009, 10:21:02 AM12/2/09
to
Hi,

During developing a sort of plugin interface for the .NET Micro Framework I
get the following problem:

To dynamically loading an assembly inside a new AppDomain I first need to
Load the Assembly in the default Appdomain with the next statement:

Assembly.Load(byte[] rawAssembly).
After I loaded the assembly in the default Appdomain it's possible to load
the assembly in a new Appdomain and create a instance of a type within this
new Appdomain. This instance runs perfectly.

Now when I want to load an updated version of a assembly who is already
loaded in the default Appdomain I get the following problem.
Because the old assembly is still loaded in the default Appdomain this
assembly is returned by executing the command Assembly.Load(newAssembly).
My new/updated assembly isn't loaded in the default Appdomain so I cannot
create a new Appdomain and loading an instance of my new assembly in it.

Is there something that I can do to solve this big problem?

oenren

unread,
Dec 3, 2009, 7:51:01 AM12/3/09
to
Another question:

Is there some sort of way to load an assembly within a AppDomain without
first loading the assembly in the default Appdomain (Assembly.Load)?

I think Appdomain.Unload() isn't usefull this way because the assemblies
loaded in the default Appdomain aren't being unloaded so loading an updated
assembly with the same name, results in executing the old assembly because
this one is still in memory and will be loaded while executing
AppDomain.Load(assembly name).

Can someone give me some hints how to prevent this behaviour?
Thanks!


0 new messages