title: Type.InvokeMember throws a MissingMethodException when I try to invoke a member with a List<KeyValuePair<string, string>> as one of the parameters
body: <p>I am trying to dynamically create a proxy using the WSDL of a WCF web service and call a method on it. The method signature in the WCF service I am trying to call by constructing a proxy at runtime is as follows:</p>
  
  <p>(I am using the DynamicProxy code from MSDN for this purpose which is located <a href="http://archive.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=netfxsamples&amp;DownloadId=3939" rel="nofollow">here</a>)</p>
  
  <p>I create a proxy using the wsdl at runtime using the following code snippet - </p>
  
  <pre><code>    var factory = new DynamicProxyFactory(wsdl);
      var proxy = factory.CreateProxy(contract);
      object value1 = topic;
      object value2 = emailMessage;
      object value3 = messageProperties; //This is of type List&lt;KeyValuepair&lt;string,string&gt;&gt;
  
       proxy.CallMethod(method, value1, value2, value3);
  </code></pre>
  
  <p>The method in the above call has the signature that is listed below:</p>
  
  <pre><code>    void ReceiveMessage(string topic, string message, List&lt;KeyValuePair&lt;string, string&gt;&gt; propertyBag);
  </code></pre>
  
  <p>Once I dynamically create a proxy for the web service containing the above method, and do a type.InvokeMember on it, I get a method not found exception.</p>
  
  <p>However, when I try to invoke a similar method with all strings as arguments, I can invoke the method successfully. For example, the following method gets invoked successfully</p>
  
  <pre><code>    void ReceiveMessage2(string message, string topic, string anything);
  </code></pre>
  
  <p>The way I am using the InvokeMember is pretty straightforward</p>
  
  <pre><code>    public object CallMethod(string method, params object[] parameters)
      {
          object retval = this.objType.InvokeMember(
              method,
              BindingFlags.InvokeMethod | CommonBindingFlags,
              null /* Binder */,
              this.obj,
              parameters /* args */);
  
          return retval;
      }
  </code></pre>
  
  <p>Can someone please help me in figuring out what I am doing wrong? I am passing the objects the same way for both the calls (ReceiveMessage and ReceiveMessage2). Thanks in advance. This has been driving me nuts.</p>
  
  <p>EDIT:</p>
  
  <p>The commonBindingFlags in the above function is actually is a wrapper for this -</p>
  
  <pre><code>     BindingFlags.Instance | BindingFlags.Public;
  </code></pre>