我使用CakeBuild来构建和测试Xamarin可移植类库。CakeBuild:无法安装工具'NUnit.ConsoleRunner'
在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诊断”:
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,https://stackoverflow.com/questions/38658660/how-to-enable-diagnostic-verbosity-for-cake – devlead
看到上面,我添加了输出到原来的问题 – Pepper
什么版本的NuGet exe?因为它无法解析软件包。无论如何,对于可重现的版本,我会建议固定一个版本。 – devlead