0

我正在 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 正在做的事情是我应该在命令行上做的吗?

4

1 回答 1

0

原来我正在使用忽略目录.gitignore的某个地方(Xamarin 自己的?)的默认值。packages从 Xamarin Studio 中运行时这很好,因为它会自动下载所需的包。

通过在我们的存储库中保留正确版本的 NUnit,这意味着不首先运行 Xamarin 的团队成员能够正常构建该工具。

于 2015-10-27T09:55:53.573 回答