I'm building a website in ASP.NET that allows creating new modules based on a common class. The new modules need to have the ability to extend the base class with their own library of methods/functions. I would like to load all modules at Application_Start. They are identified by a unique string key.
The structure is something like this:
root -Bin --module1.dll --module2.dll -Modules --module1 ---mod.key1 --module2 ---mod.key2
At startup each module folder is read and it's key identified, all settings loaded from db and common properties set, then stored in a collection. When a page is requested for a module, the base page class loads the appropriate module using it's unique directory key. Problem is the base module class does not contain the library of methods specific to that module (Only it's properties/settings loaded from db). How can I extend the module class to include methods during the module load at startup, or just instantiate the correct extended class dynamically using it's string name? or any other ideas? I don't want to hard code class names in the app load method so it can scale for future modules to be added.