使用F#FAKE测试PCL

时间:2014-03-11 13:45:21

标签: c# mstest portable-class-library f#-fake

我有一个包含PCL类库项目和测试库(MSTest)的测试项目的解决方案。 PCL使用Microsoft.Net.HttpMicrosoft.Bcl.Compression进行一些gzip下载。 PCL和测试项目都使用Nuget引用了之前提到的库。

当我在Visual Studio中运行测试时,测试工作并通过。当我从F#FAKE运行测试时

Target "MainTests" (fun _ ->
    !! (testDir + @"my-dll-name.dll") 
      |> MSTest (fun p -> p)
)

所有测试均以

失败
Test method XXX.AvailableLanguagesShoudlExist threw exception: 
System.MissingMethodException: Method not found: 'Void     
System.Net.Http.HttpClientHandler.set_AutomaticDecompression(System.Net.DecompressionMethods)'.

1 个答案:

答案 0 :(得分:1)

这里的问题可能是你的Mstest.exe使用了错误的F#或FSharp.Core.dll版本 - 我想我们需要更多细节来解决这个问题。

  • 请确保Visual Studio构建过程和FAKE构建过程使用相同的版本。
  • 也许你需要使用绑定重定向
相关问题