title: Call dynamic methods using reflection in C#
body: <p>I have a DynamicObject-based class that implements an interface dynamically (via TryGet* and TryInvoke*). I want to call the methods that it implements using reflection. The problem is that it throws a TargetException (Object does not match target type).</p>
  
  <p>Like I said, it's dynamic, so it forwards the calls via a series of connections as text to another program, which then calls the destination method using reflection. It is basically a proxy class. The method names are known at compile time (because of the interface), but are called externally.</p>
  
  <pre><code>typeof(ITelescope).GetMethod(Console.ReadLine()).Invoke(prox,null);
  </code></pre>
  
  <p>ITelescope is the interface, <code>prox</code> is the dynamic object.</p>