public override object CreateModule() { if (ModuleType.BaseType != typeof(object)) { throw new BindingException("Modules must inherit only from System.Object."); } var ctor = ModuleType.GetConstructor(Type.EmptyTypes); if (ctor == null) { throw new BindingException("Modules must have a public default constructor."); } return(ctor.Invoke(null)); }