I want to run a .net core NUnit test with the vstest.console.
This is working fine but I want to pass to the "dotnet test" execution a parameter, in my case "--no-build"
How I can parse this parameter to the dotnet execution? I have not found the right runsettings variable
vstest.console.exe " "project.json" /UseVsixExtensions:true /Settings:settings.runsettings
["C:\Program Files\dotnet\dotnet.exe" test "project.json" --port 55307 --no-build]
["C:\Program Files\dotnet\dotnet.exe" test "project.json" --port 55307 ]
windows 7
project.json
{
"version": "1.0.0-*","dependencies": {
"NUnit": "3.5.0",
"dotnet-test-nunit": "3.4.0-beta-3"
},"testRunner": "nunit",
"frameworks": {
"netcoreapp1.0": {
"imports": "portable-net45+win8",
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0-*",
"type": "platform"
}
}
}
}
}`
@aumanjoa the support for passing arguments to adapters through vstest.console is supported only for csproj based test projects.
For project.json based test projects, please use the dotnet test command (that ships with dotnet-cli preview2) for this feature.
@codito many thanks for the answere.
@codito I'm using a csrpoj based project. How can I pass a command line argument to dotnet test and somehow read the value in my tests?
Most helpful comment
@codito I'm using a csrpoj based project. How can I pass a command line argument to
dotnet testand somehow read the value in my tests?