title: How to return two values from F# to C#
body: <p>I have an F# function returning a string and an array to some C# code. I tried a few ways and did some searching to no avail. How is this done? My F# function (Gen.Best) ends with:</p>
  
  <pre><code>(T1 Best).ToString,T2 Best // return a (string) and a (float []) to C#
  </code></pre>
  
  <p>F# shows the return type as (unit -> String) * float []
  (T1 Best) is a (float -> float) function.</p>
  
  <p>In my C# code I have:</p>
  
  <pre><code>Tuple&lt;string, double[]&gt; Ans = Gen.Best(XData, ResultData);
  </code></pre>
  
  <p>The compiler complains: </p>
  
  <blockquote>
    <p>The type 'Microsoft.FSharp.Core.Unit' is defined in an assembly that is not referenced. You must add a reference to assembly 'FSharp.Core, Version=4.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.<br/>
    C:\Users\JDL\Dropbox\Formulas\VS Bogdan\Quirkle\MainForm.cs 139 13  Quirkle</p>
  </blockquote>
  
  <p>How do I add a reference to the assembly? (I'm new to F#)</p>
  
  <p>and</p>
  
  <blockquote>
    <p>Cannot implicitly convert type 'System.Tuple&lt;Microsoft.FSharp.Core.FSharpFunc`2&lt;Microsoft.FSharp.Core.Unit,string>,double[]>' to 'System.Tuple&lt;string,double[]>'<br/>
    C:\Users\JDL\Dropbox\Formulas\VS Bogdan\Quirkle\MainForm.cs 139 46  Quirkle</p>
  </blockquote>