【发布时间】:2015-10-26 17:36:37
【问题描述】:
我正在 Mac OS X 上的 Xamarin 中构建命令行工具。一般来说,我的工作流程是在 Xamarin Studio 中构建和测试。然后我有一个在命令行上构建的发布构建脚本,使用:
xbuild /p:Configuration=Release myTool.sln
但是,我从单元测试子项目中的文件中得到错误,而我在正常构建项目时没有得到:
Tests.cs(13,6): error CS1729: The type `NUnit.Framework.TestFixtureAttribute' does not contain a constructor that takes `1' arguments
Tests.cs(14,6): error CS1729: The type `NUnit.Framework.TestFixtureAttribute' does not contain a constructor that takes `1' arguments
Tests.cs(759,20): error CS0117: `NUnit.Framework.Assert' does not contain a definition for `Throws'
请注意,这仅在从干净项目构建时,从 git 新鲜同步。只要我在 Xamarin Studio 中打开解决方案并从那里构建,命令行构建脚本就会正常工作。
Xamarin 正在做的事情我也应该在命令行上做吗?
【问题讨论】:
-
我将使用 xbuild 和 Xamarin Studio 运行诊断构建,看看它们是否都使用相同的 NUnit 程序集。我猜是选错了,可能是 Mono 附带的旧版本。
-
感谢@MattWard!情况似乎确实如此。找到了解决方案并在此处发布了我自己的问题的答案。
标签: c# macos xamarin nunit xbuild