在命令行上更新Nunit-Console



我正在尝试将我的Nunit-Console版本2.4.8升级到最新版本或至少为版本3。我在网上找到的唯一帮助是关于Visual Studio并将其升级,但是我正在使用Mac工作,在我的VS中,它已经具有最新版本。

我认为我的搜索方式是关于命令行上的nuget,例如

nuget update nunit-console

,但它给了我以下错误

No packages.config, project or solution file specified. Use the -self switch to update NuGet.exe.

什么是正确的命令,或者有其他我需要去的方式?

预先感谢

您正在尝试更新与单声道发行的Nunit-Console?您不能仅通过使用nuget进行更新。

相反,我只需下载您要从Nuget使用的Nunit Console Runner,然后使用单声道调用该赛跑者。获得控制台跑步者的一种简单方法是运行:

nuget install NUnit.ConsoleRunner

这将下载最新的Nunit Console Runner并将其提取到:

NUnit.ConsoleRunner.3.7.0/tools/nunit3-console.exe

然后直接使用上述nunit3-console.exe跑步者使用mono:

mono full/path/to/NUnit.ConsoleRunner.3.7.0/tools/nunit3-console.exe

或如果您想拥有一个nunit3-console命令,那么我会查看现有的Nunit-Console脚本/Library/Frameworks/Mono.framework/Versions/Current/Commands/nunit-console

#!/bin/sh
exec /Library/Frameworks/Mono.framework/Versions/5.8.0/bin/mono --debug $MONO_OPTIONS /Library/Frameworks/Mono.framework/Versions/5.8.0/lib/mono/4.5/nunit-console.exe "$@"

然后根据此脚本创建自己的自己,但请使用您下载的新的Nunit Console Runner。

您可能想将此脚本放在其他地方而不是/Library/Frameworks/Mono.framework/Versions/Current/Commands/以避免在更新单声道时将其删除。

最新更新