Xamarin Studio 在Mac上构建F#项目失败

3

我创建了一个简单的Xamarin Studio F#项目和F#单元测试项目。当我构建时,我收到以下提示:

unknown-file(1,1): Error FS2020: The assembly
 'Studio.app/Contents/MacOS/lib/monodevelop/AddIns/NUnit/nunit.framework.dll'
  is listed on the command line. 
  Assemblies should be referenced using a command line flag such as 
  '-r'. (FS2020) (FRXUI.Spec)

在生成模板项目后,我没有进行任何源代码更改。

2个回答

5
问题出在文件路径中的空格,应该将引用改为: /Applications/Xamarin Studio.app/Contents/MacOS/lib/monodevelop/AddIns/NUnit/nunit.framework.dll 这里有一个已知问题,请参见此处: https://github.com/fsharp/fsharpbinding/issues/111 您也可以通过使用nuget来解决问题。我几乎总是在F#中使用NUnit进行单元测试,并配合fsunit使用。如果你没有安装nuget,你也可以获取monodevelop-nuget-addin,它可以使这些包的安装非常容易。

1
我完全不知道有一个NuGet插件!+1 - Chris Barrett

3
我也遇到了这个问题。我通过将测试项目中对nunit.framework的引用替换为从源代码构建的版本来解决它。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接