DLL loading Question

D

DaveP

How can i dynamically load a Dll and unload said Dll
using c#
i have a Situation where i have many dlls that are client based and only
need to be loaded and code executed based on client ID.

for instance
i have a Service Running the gets Record sets for output file formating
based on client Requirements
and this service reads a dll to load and instantiate classes based on
clientID

so service would load the dll
execute Class Inside the dll , create output file
service unload dll

TIA
DaveP
 
N

Nicholas Paldino [.NET/C# MVP]

But you can't unload the dll unless you unload the app domain which the
assembly was loaded in. This would mean that you have to create a new app
domain and run the code in that app domain.
 
D

DaveP

any Examples anywhere that you may know of

doesn't SSiS do somthing like this with SSiS Packages

TIA
DaveP

Nicholas Paldino said:
But you can't unload the dll unless you unload the app domain which the
assembly was loaded in. This would mean that you have to create a new app
domain and run the code in that app domain.


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

David Yang said:
You can use assembly class to load the dll if the dll is an assembly.
 
H

Hoop

any Examples anywhere that you may know of

doesn't SSiS do somthing like this with SSiS Packages

TIA
DaveP

message



- Show quoted text -

Hi Dave,
I have done what I think you are trying to do using reflection. Your
app would then have to be aware of the dll's interface and then load
that at runtime.
Maybe this is not what you are looking for. Check out some plugin
examples at CodeProject.
Jeff
 
D

DaveP

sounds like thats exactly what im looking for
i need to load and unload the dlls base on customer transactions

tks i'll go look up the plug ins in codeproject
DaveP
 

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