title: Getting Unhandled Exception: System.Reflection.TargetParameterCountException: Parameter count mismatch
body: <p>I'm getting Parameter count mismatch exception:</p>
  
  <blockquote>
    <p>Getting Unhandled Exception: System.Reflection.TargetParameterCountException: Parameter count mismatch.</p>
  </blockquote>
  
  <p>Code:</p>
  
  <pre><code>class Program
      {
          public static void Main()
          {
              ArrayList CustomerList = new ArrayList();
              CustomerList.Add("Robinson");
              CustomerList.Add("Pattison");
              CustomerList.Add("Todd");
  
              object[] obj = (object[])CustomerList.ToArray(typeof(object));
              Assembly executingAssembly = Assembly.GetExecutingAssembly();
              Type customerType = executingAssembly.GetType("LateBinding.Customer");
              object customerInstance = Activator.CreateInstance(customerType);
              MethodInfo method = customerType.GetMethod("printCustomerDetails");
              string customerObject = (string)method.Invoke(customerInstance, obj);
              Console.WriteLine("Value is : {0}", customerObject);
          }
      }
      public class Customer
      {
          public string printCustomerDetails(object[] parameters)
          {
              string CustomerName = "";
              foreach (object customer in parameters)
              {
                  CustomerName = CustomerName + " " + customer;
              }
              return CustomerName.Trim();
          }
      }
  </code></pre>