【发布时间】:2017-08-30 16:43:54
【问题描述】:
我使用 CakeBuild 来构建和测试我的 Xamarin 可移植类库。
在 build.cake 脚本中,我定义了我想使用 NUnit-Console 来运行我的测试用例。所以我愿意
#tool nuget:?package=NUnit.ConsoleRunner
不幸的是,当我运行 Cake 脚本时出现以下错误。
Preparing to run build script...
VERBOSE: Restoring tools from NuGet...
VERBOSE: Feeds used:
C:\Users\bergkar\.nuget\packages\
All packages listed in C:\dev\Xamarin\fleetboard-core-library\tools\packages.config are already installed.
Running build script...
Analyzing build script...
Processing build script...
Installing tools...
Unable to find package 'NUnit.ConsoleRunner'
NuGet exited with 1
Could not find any relevant files for tool 'NUnit.ConsoleRunner'. Perhaps you need an include parameter?
Error: Failed to install tool 'NUnit.ConsoleRunner'.
当我添加一个我想使用的特定版本时,一切正常。
#tool nuget:?package=NUnit.ConsoleRunner&version=3.7.0
有人能告诉我为什么没有版本的东西就不能工作吗?
使用“.\build.ps1 -Verbosity Diagnostic”我得到以下输出:
Preparing to run build script...
Running build script...
Module directory does not exist.
Analyzing build script...
Analyzing C:/dev/Xamarin/fleetboard-core-library/build.cake...
Processing build script...
Installing tools...
Installing NuGet package NUnit.ConsoleRunner...
Executing: "C:/dev/Xamarin/fleetboard-core-library/tools/nuget.exe" install "NUnit.ConsoleRunner" -OutputDirectory "C:/d
ev/Xamarin/fleetboard-core-library/tools" -ExcludeVersion -NonInteractive
Unable to find package 'NUnit.ConsoleRunner'
NuGet exited with 1
Feeds used:
Output:
Feeds used:
Could not find any relevant files for tool 'NUnit.ConsoleRunner'. Perhaps you need an include parameter?
Error: Cake.Core.CakeException: Failed to install tool 'NUnit.ConsoleRunner'.
at Cake.Core.Scripting.ScriptProcessor.InstallTools(ScriptAnalyzerResult analyzerResult, DirectoryPath installPath)
at Cake.Core.Scripting.ScriptRunner.Run(IScriptHost host, FilePath scriptPath, IDictionary`2 arguments)
at Cake.Commands.BuildCommand.Execute(CakeOptions options)
at Cake.CakeApplication.Run(CakeOptions options)
at Cake.Program.Main()
【问题讨论】:
-
如果你推出带有诊断冗长的蛋糕,你会得到什么?你应该可以看到 nuget.exe 是如何被调用的,stackoverflow.com/questions/38658660/…
-
见上文,我将输出添加到原始问题中
-
什么版本的 NuGet exe?因为它无法解决包。无论如何,对于可复制的构建,我建议固定一个版本。
-
NuGet 版本是版本:4.1.0.2450。由 CakeBuild 自动下载。