Assembly dynamic loading

  • Thread starter Thread starter =?iso-8859-1?Q?Val=E9ry?=
  • Start date Start date
?

=?iso-8859-1?Q?Val=E9ry?=

I am currently developing an application, which receives
Assembly objects from the network. I would like to load
these assemblies dynamically in the application.
I looked the informations about the Load and
LoadWithPartialName methods. If I have well understood,
these methods look first in the application directory for
the assembly and then in the GAC.

So I suppose in order to load my assemblies, I first have
to save them to disk (I want them in the application
directory and not in the GAC). I don't know how to do this
operation from an Assembly object.

Furthermore, does an Assembly object contain just the
information about the assembly or does it also contains
the compiled code?

Thanks a lot for helping.

Valéry Bezençon
 
Valéry,

You will need to make sure that the assemblies are located in the
application directory. You can not save an assembly using the assembly
object. If you want to load them from a network share, then you can call
the static LoadFile method on the Assembly class to load the assembly from a
network share. However, you have to be careful, as this will cause the
assembly to run with a limited permission set (unless configured otherwise).

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

I am currently developing an application, which receives
Assembly objects from the network. I would like to load
these assemblies dynamically in the application.
I looked the informations about the Load and
LoadWithPartialName methods. If I have well understood,
these methods look first in the application directory for
the assembly and then in the GAC.

So I suppose in order to load my assemblies, I first have
to save them to disk (I want them in the application
directory and not in the GAC). I don't know how to do this
operation from an Assembly object.

Furthermore, does an Assembly object contain just the
information about the assembly or does it also contains
the compiled code?

Thanks a lot for helping.

Valéry Bezençon
 
Back
Top