diff --git a/src/Cli/dotnet/Commands/Test/TestingPlatformCommand.Help.cs b/src/Cli/dotnet/Commands/Test/TestingPlatformCommand.Help.cs index 9113c4a010cc..6a0b6d04030c 100644 --- a/src/Cli/dotnet/Commands/Test/TestingPlatformCommand.Help.cs +++ b/src/Cli/dotnet/Commands/Test/TestingPlatformCommand.Help.cs @@ -143,6 +143,13 @@ private Dictionary> GetAllOptions() value.Add(option.Value); } } + + // Sort options alphabetically by name + foreach (var optionsList in builtInToOptions.Values) + { + optionsList.Sort((x, y) => string.Compare(x.Name, y.Name, StringComparison.OrdinalIgnoreCase)); + } + return builtInToOptions; }