运行 dotnet test 命令时出现如下的错误:
No executable found matching command "dotnet-test-xunit"
project.json中的配置如下:
{ "version": "1.0.0-*", "dependencies": { "Microsoft.NETCore.App": { "type": "platform", "version": "1.1.0" }, "Microsoft.Extensions.DependencyInjection": "1.1.0", "Cnblogs.ServiceAgent": "1.0.0.4", "xunit": "2.2.0-beta4-build3444", "dotnet-test-nunit": "3.4.0-beta-3" }, "frameworks": { "netcoreapp1.1": {} }, "testRunner": "xunit" }
请问如何解决这个问题?
汗,是一个低级错误引起的,写错了NuGet包的名称,应该是dotnet-test-xunit,而不是dotnet-test-nunit。
"dotnet-test-nunit": "3.4.0-beta-3"
改为
"dotnet-test-xunit": "2.2.0-preview2-build1029"