Dynamic loading DLL files

  • Thread starter Thread starter Arek
  • Start date Start date
A

Arek

Hi,

I'm porting application from C++ to C#. This application has several plugins
(DLL files). All plugins are using same interface (IPlugin) and have
function which returns pointer to this interface. App checks specified
folder on start, loads all DLL files into memory and creates collection of
this pointers (IPlugin).
How to do it in C#? How to load perform dynamic load DLL library in C#? How
to retrieve an interface?

Thanks,
Arek
 
You will want to use Assembly.LoadFromFile(), then reflection to determine
classes implimenting the interface.
 
Back
Top