I have to implement a plugin architecture for my application.
I have the main application and library that I need to load at runtime. I need my main application to know about classes defined in dll to correctly process them during the dynamic call.
Am I need to implement additional dll with Interface to achieve this goal or It is some other way doing this?
You can load the library using Assembly.Load, and then you need a way to detect which types you need to instantiate. You can mark classes with an interface (i.e. IPlugin) and then see if the type you are inspecting can be assigned to the IPlugin type using the IsAssignableFrom method. Another approach is to mark your classes with custom attributes and see if the type you are inspecting has that attribute (i.e. PluginAttribute). In both cases you need to put the interface or the attribute class in a third library so it can be referenced in the main application and in the plugin library.