title: How to invoke Constructors by String in C# (i.e. by Reflection)?
body: <p>I use the Chart class WPFToolKit and I want to invoke Construtors by String to short the code below <br/></p>
  
  <pre><code>switch (node.Attributes["type"].Value)
  {
      case "ColumnSeries":
          ans = new ColumnSeries();
          break;
      case "PieSeries":
          ans = new PieSeries();
          break;
      case "AreaSeries":
          ans = new AreaSeries();
          break;
      case "BarSeries":
          ans = new BarSeries();
          break;
      case "LineSeries":
          ans = new LineSeries();
          break;
  }
  </code></pre>
  
  <p>After searching I find the code below:</p>
  
  <pre><code>Type type = Type.GetType(node.Attributes["type"].Value);
  Console.WriteLine(type == null);
  ConstructorInfo ctor = type.GetConstructor(new Type[] { });
  object instance = ctor.Invoke(new object[]{});
  </code></pre>
  
  <p>But strangely, the type is always null and I don't why. Could anyone tell me that?
  Thanks.</p>