【发布时间】:2016-02-26 17:59:31
【问题描述】:
尝试使用 Visual Studio Community 15 和 MathNet.Numerics.sln 从 GitHub 构建最新版本的 MathNet Numerics,这需要安装用于单元测试的 DLL。
Could not resolve this reference. Could not locate the assembly "FsUnit.CustomMatchers".
Could not resolve this reference. Could not locate the assembly "FsUnit.NUnit".
Could not resolve this reference. Could not locate the assembly "nunit.framework".
因此,在 Visual Studio 中使用 NuGet 可以成功安装以下内容。
Successfully installed 'NUnitTestAdapter.WithFramework 2.0.0' to UnitTests
Successfully installed 'FSharp.Core 3.1.2.5' to FSharpUnitTests
Successfully installed 'NUnit 3.0.1' to FSharpUnitTests
Successfully installed 'FsUnit 2.0.0' to FSharpUnitTests
剩下的唯一DLL是
FsUnit.CustomMatchers
我找不到。
hint是..\..\packages\test\FsUnit\lib\FsUnit.CustomMatchers.dll,但packages下没有test目录。
如何正确解决这个问题?
我是否需要 DLL,如果需要,它可以在哪里找到?
我需要手动修复代码吗?
我需要更新提示吗?
TLDR;
如果我在没有缺少 DLL 的情况下构建,则基本错误是:
A unique overload for method 'IsTrue' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates:
Assert.IsTrue(condition: Nullable<bool>, message: string, [<ParamArray>] args: obj []) : unit,
Assert.IsTrue(condition: bool, message: string, [<ParamArray>] args: obj []) : unit
可以通过安装解决
Microsoft.VisualStudio.QualityTools.UnitTestFramework
添加
open Microsoft.VisualStudio.TestTools.UnitTesting
签名为
Assert.IsTrue(condition: bool, message: string, [<ParamArray>] args: obj []) : unit
但这是不正确的,因为它没有安装正确的 DLL(Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll 与 FsUnit.CustomMatchers),并且根据过去 F# 单元测试的经验,我知道这样做可能会导致误报。
编辑:
成功安装后,我想知道这是在哪里记录的。
全自动构建,包括
unit tests、文档和 api 参考,NuGet 和 Zip 包使用 FAKE。
【问题讨论】:
标签: f# visual-studio-2015 nunit mathnet-numerics fsunit