title: Converting F# functions to System.Func causes "System.Reflection.TargetException : Non-static method requires a target."
body: <p>I'd like to get MethodInfo for caller-provided functions.</p>
  <pre class="lang-ml prettyprint-override"><code>module MethodInfo = 
      let from0 (f: unit -&gt; 'a) = (Func&lt;'a&gt;(f)).Method
      let from1 (f: 'a -&gt; 'b) = (Func&lt;'a,'b&gt;(f)).Method
  
  let mi = MethodInfo.from0 (fun () -&gt; 5)
  mi.Invoke(null, Array.empty&lt;obj&gt;)
  </code></pre>
  <p>This compiles, but always throws &quot;System.Reflection.TargetException : Non-static method requires a target.&quot;</p>
  <p>The exception is not thrown if I pass an anonymous function directly to a method.</p>
  <pre class="lang-ml prettyprint-override"><code>type MethodInfo =
      static member from0 (f:Func&lt;'a&gt;) = f.Method
      static member from1 (f:Func&lt;'a,'b&gt;) = f.Method
  
  MethodInfo.from0 (fun () -&gt; 5)
  mi.Invoke(null, Array.empty&lt;obj&gt;)
  </code></pre>
  <p>Why does the conversion from F# functions to Func cause this exception? Is there a better way to get MethodInfo (some update since <a href="https://stackoverflow.com/questions/1575180/retrieve-methodinfo-of-a-f-function">this old thread</a>)?</p>