how to load assembly dinamically

C

chandu

I want to load an assembly dinamically into another application with a
button click.

how to load and execute that dinamic assebly..

i tried like this
copied that target assebly in bin folder and like........
AppDomain newdomain = AppDomain.CreateDomain("RMS");

newdomain.ExecuteAssembly("dllsample.dll");

but it is creating new appdomain ,i dont want to create new domain and in
same appdomain i need to load..


thank u

thank u
 
?

=?ISO-8859-1?Q?=22Andr=E9s_G=2E_Aragoneses_=5B_kno

chandu escribió:
I want to load an assembly dinamically into another application with a
button click.

how to load and execute that dinamic assebly..

i tried like this
copied that target assebly in bin folder and like........
AppDomain newdomain = AppDomain.CreateDomain("RMS");

newdomain.ExecuteAssembly("dllsample.dll");

but it is creating new appdomain ,i dont want to create new domain and in
same appdomain i need to load..

Look at the static method LoadFrom() in the Assembly class.

Regards,

Andrés [ knocte ]

--
 
G

Guest

Not sure what your end goal for this is but it might be better to load your
assemblies to another app domain.
The app domain is in the same process space (although does require
marshalling for cross app domain boundary calls.
It is also the only way you would be able to unload the dll when your
finished with it as you cant remove an assembly from an app domain but you
could unload the whole app domain. Just incase you wanted to unload it to
conserve resources.

HTH

Ciaran O'Donnell
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top