title: Delegate.CreateDelegate is unable to bind to static generic methods
body: <p>I'm trying to use <code>Delegate.CreateDelegate</code> <a href="http://msdn.microsoft.com/en-us/library/1xw3bk13.aspx" rel="nofollow">[MSDN link]</a> to bind to a static generic method, but the binding fails.
  Here is the PoC code:</p>
  
  <pre><code>public static class CreateDelegateTest {
      public static void Main() {
          Action actionMethod = CreateDelegateTest.GetActionDelegate();
          Action&lt;int&gt; intActionMethod = CreateDelegateTest.GetActionDelegate&lt;int&gt;();
          Func&lt;int&gt; intFunctionMethod = CreateDelegateTest.GetFunctionDelegate&lt;int&gt;();
      }
  
      public static Action GetActionDelegate() {
          return (Action)Delegate.CreateDelegate(typeof(Action), typeof(CreateDelegateTest), "ActionMethod");
      }
  
      public static Action&lt;T&gt; GetActionDelegate&lt;T&gt;() {
          return (Action&lt;T&gt;)Delegate.CreateDelegate(typeof(Action&lt;T&gt;), typeof(CreateDelegateTest), "GenericActionMethod");
      }
  
      public static Func&lt;TResult&gt; GetFunctionDelegate&lt;TResult&gt;() {
          return (Func&lt;TResult&gt;)Delegate.CreateDelegate(typeof(Func&lt;TResult&gt;), typeof(CreateDelegateTest), "GenericFunctionMethod");
      }
  
      public static void ActionMethod() { }
  
      public static void GenericActionMethod&lt;T&gt;(T arg) { }
  
      public static TResult GenericFunctionMethod&lt;TResult&gt;() {
          return default(TResult);
      }
  }
  </code></pre>
  
  <p>The <code>actionMethod</code> is created properly, but the <code>intActionMethod</code> and <code>intFunctionMethod</code> creation throws.</p>
  
  <p><strong>Why is <code>CreateDelegate</code> unable to bind to generic methods? How to bind to them?</strong></p>
  
  <p>I've submitted the bug on Microsoft Connect <a href="https://connect.microsoft.com/VisualStudio/feedback/details/775129/delegate-createdelegate-is-unable-to-bind-to-a-static-generic-function-method" rel="nofollow">[link]</a>. If you think that this is a bug, vote for it, please.</p>
  
  <p><strong>Update 2:</strong> I was wrong thinking that binding to the non-function generic methods succeeds. It turned out that any generic method fails to bind.</p>