title: Reflection to invoke the constructor with ConstructorInfo
body: <p>In a very Simple class like below,</p>
  
  <pre><code>class Program 
  {
  
      public Program(int a, int b, int c)
      {
          Console.WriteLine(a);
          Console.WriteLine(b);
          Console.WriteLine(c);
      }
   }
  </code></pre>
  
  <p>and I use reflection to invoke the constructor </p>
  
  <p>something like this...</p>
  
  <pre><code>   var constructorInfo = typeof(Program).GetConstructor(new[] { typeof(int), typeof(int),      typeof(int) });
          object[] lobject = new object[] { };
          int one = 1;
          int two = 2;
          int three = 3;
          lobject[0] = one;
          lobject[1] = two;
          lobject[2] = three;
  
          if (constructorInfo != null)
          {
              constructorInfo.Invoke(constructorInfo, lobject.ToArray);
          }
  </code></pre>
  
  <p>But I am getting an error saying "object does not match target type constructor info".</p>
  
  <p>any help/comments greatly appreciated.
  thanks in advance.</p>