diff --git a/src/Cli/dotnet/commands/dotnet-test/Program.cs b/src/Cli/dotnet/commands/dotnet-test/Program.cs index 4cce5cee57cf..993b52d2f54d 100644 --- a/src/Cli/dotnet/commands/dotnet-test/Program.cs +++ b/src/Cli/dotnet/commands/dotnet-test/Program.cs @@ -121,7 +121,8 @@ private static TestCommand FromParseResult(ParseResult result, string[] settings // Extra msbuild properties won't be parsed and so end up in the UnmatchedTokens list. In addition to those // properties, all the test settings properties are also considered as unmatched but we don't want to forward - // these as-is to msbuild. So we filter out the test settings properties from the unmatched tokens. + // these as-is to msbuild. So we filter out the test settings properties from the unmatched tokens, + // by only taking values until the first item after `--`. (`--` is not present in the UnmatchedTokens ). var unMatchedNonSettingsArgs = settings.Length > 1 ? result.UnmatchedTokens.TakeWhile(x => x != settings[1]) : result.UnmatchedTokens;