views:

32

answers:

2

Hi,

Is it possible for my application to monitor a folder that if we copy a DLL (library) in it, the application will pick it up and link it?

I did a similar thing in C++ back in the days but is it possible to dynamically link a library in .NET?

Thanks

+1  A: 

Using reflection you could.

Poll the directory for added files, and then if you find one, load it using reflection and run some Main method inside it.

However you can't "unload" these DLLs unless they are loaded into seperate AppDomains.

Aequitarum Custos
+1  A: 

Absolutely. See this SO question or consider using the MEF.

plinth
MEF looks promising, haven't had a chance to play with yet though.
Aequitarum Custos