Unquote: What am I missing?

I am trying to get the Unquote library working with xUnit in .NET 4, and I was not lucky everyone gets the tests to run. So, I broke it into the simplest ways to play. Does anyone know what I can lose?

  • Create a new F # library project.
  • Use NuGet to add xUnit and Unquote links.
  • Paste the following code ...

I got the actual test directly from the Unquote homepage, but the content does not matter because it does not start.

module Tests open Xunit open Swensen.Unquote [<Fact>] let ``demo Unquote xUnit support`` () = test <@ ([3; 2; 1; 0] |> List.map ((+) 1)) = [1 + 3..1 + 0] @> 

Then I compile the assembly and load it into the xUnit.net GUI test runner (64-bit, CLR 4) and get the following error when running the test:

 Tests.demo Unquote xUnit support : System.MissingMethodException : Method not found: 'Microsoft.FSharp.Collections.FSharpList`1<Microsoft.FSharp.Quotations.FSharpExpr> Swensen.Unquote.Extensions.Expr.ReduceFully(Microsoft.FSharp.Quotations.FSharpExpr)'. Stack Trace: at Tests.demo Unquote xUnit support() 
+3
source share
1 answer

Nothing, I figured it out. I am using VS 11 Preview, and although I am targeting .NET 4.0 in my project, the project refers to the wrong version of FSharp.Core.dll:

C: \ Program Files (x86) \ Reference Assemblies \ Microsoft \ FSharp \ 3.0 \ Runtime \ v4.0 \ FSharp.Core.dll

I modified it to refer to this instead, and it all started correctly:

C: \ Program Files (x86) \ Reference Assemblies \ Microsoft \ FSharp \ 2.0 \ Runtime \ v4.0 \ FSharp.Core.dll

+6
source

All Articles