title: System.MissingMethodException: Cannot create an abstract class
body: <p><strong>ExtendedCommandManager.cs</strong></p>
  
  <pre><code>var assembly = AppDomain.CurrentDomain.GetAssemblies();
  var types = assembly.SelectMany(s =&gt; s.GetTypes()).Where(p =&gt; typeof(ICommand).IsAssignableFrom(p));
  foreach (var type in types)
  {
     source.Commands.Add((ICommand) Activator.CreateInstance(type)); 
  }
  
  return source; 
  </code></pre>
  
  <p>type inherited ICcommand But why is there an error?</p>
  
  <p><strong>Error</strong></p>
  
  <pre><code>Unhandled exception. System.MissingMethodException: Cannot create an abstract class.
     at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean wrapExceptions, Boolean&amp; canBeCached, RuntimeMethodHandleInternal&amp; ctor, Boolean&amp; hasNoDefaultCtor)
     at System.RuntimeType.CreateInstanceDefaultCtorSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean fillCache)
     at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, Boolean wrapExceptions)
     at System.Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions)
     at System.Activator.CreateInstance(Type type)
     at BASE.CommandControllers.ExtendedCommandManager.Load[T](T source) in D:\CLang\DicordProject\Discord\BASE\CommandControllers\ExtendedCommandManager.cs:line 16
  </code></pre>