title: C# DynamicInvoke TargetParameterCountException
body: <p>i've been searching a while now but i haven't found a solution for my Problem. I've got a class that stacks methods on a list and then calls them one by one.
  Everything works fine with return values, Parameters or methods without Parameters. But if a method has a optional Parameter it doesn't work.</p>
  
  <p>This is just a simple testing method:</p>
  
  <pre><code>static void TestMe(Int32 _wait = 5000)
  {
      //Pretend to do stuff...
      System.Threading.Thread.Sleep(_wait);
  }
  </code></pre>
  
  <p>I add the method to my stack with:</p>
  
  <pre><code>static StackHandler __handler = new StackHandler();
  
  __handler.AddMethod(new Action&lt;Int32&gt;(TestMe));
  </code></pre>
  
  <p>The <code>AddMethod</code> method creates a new ListItem and adds it into an internal list to Keep track of all stacked methods.
  Then the handler wants to call the method with:</p>
  
  <pre><code>private object invokeMethod(Delegate _method, params object[] _args)
  {
      return _method.DynamicInvoke(_args);
  }
  </code></pre>
  
  <p>I get a <code>System.Reflection.TargetParameterCountException</code> in the <code>invokeMethod</code> method. I've also tried to call it without the <code>args</code> Parameter, same result.
  If i add the method <code>TestMe</code> like this:</p>
  
  <pre><code>__handler.AddMethodAsync(new Action&lt;Int32&gt;(Method), 6000);
  </code></pre>
  
  <p>It just runs fine.</p>
  
  <p>How can i get this to work with optional Parameters?</p>