Could we make moduleName not manadory?

Jun 15, 2008 at 7:01 PM
I was playing around with the config file module enumerator and thought it would be nice to not have to specify the module name and possibly type. My idea would be that if they were supplied they would be used as is the current behaviour, though if not used then the following would occur
  • Use reflection to get the assembly file specified in config file.
  • If moduleType was specified in config file use that to get the type from the assembly other wise use reflection to find the first implementation of IModule.
  • Once the type has been found use ModuleName from ModuleAttribute if it was not specified in the config file.
  • If startupLoaded was also not specified look to see if StartupLoaded is true against ModuleAttribute.
This way the App.config would serve as an override to the behaviour specified in the module and would only require the assemblyFile to be specified. I tried to give it a bit of a go looking at the code used in the DirectoryLookupModuleEnumerator but my lack of knowledge with AppDomain is limiting me.

This would be a nice to have feature with no great deal of importance. If I do manage to nail it in my spare time I'll post my results.