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.
 

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

Back
Top