title: MethodInfo.CreateDelegate throws exception
body: <p>I am having problems with the <code>MethodInfo.CreateDelegate</code> on a win8.1 phone project, it just seems to return an error even though I can manually create a delegate instance. </p>
  
  <pre><code>Private thisworksFine As New returnDel(AddressOf WorkWith_Return)
  </code></pre>
  
  <p>The error I get returned is</p>
  
  <blockquote>
    <p>methodIf.CreateDelegate(GetType(returnDel2))   {System.ArgumentException: Cannot bind to the target method because its signature or security transparency is not compatible with that of the delegate type.     at System.Reflection.RuntimeMethodInfo.CreateDelegateInternal(Type delegateType, Object firstArgument, DelegateBindingFlags bindingFlags, StackCrawlMark&amp; stackMark)     at System.Reflection.RuntimeMethodInfo.CreateDelegate(Type delegateType)} System.ArgumentException</p>
  </blockquote>
  
  <p>This is the code</p>
  
  <pre><code>Private Delegate Sub returnDel(intErrorId As Integer, strErrorMsg As String)
  
  Private Sub WorkWith_Return(intErrorId As Integer, strErrorMsg As String)
  
  End Sub
  
  Sub sDeligateTesting()
      Dim methodInfos As MethodInfo() = GetType(MyClass).GetRuntimeMethods()
  
      For Each methodIf As MethodInfo In methodInfos
          If methodIf.Name = "WorkWith_Return" Then
              Dim ThisDoesNotWork = methodIf.CreateDelegate(GetType(returnDel)) &lt;--Errror here
          End If
      Next
  End Sub
  </code></pre>
  
  <p>Can anyone help me by pointing out where I'm going wrong?</p>