diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index 260c35a22a..37aac9a99f 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -9,6 +9,10 @@
https://github.com/microsoft/clrmd
d724947392626b66e39b525998a8817447d50380
+
+ https://github.com/dotnet/dotnet
+ 78061f4bcc414fa2054be6237b1fd3813d8edf6b
+
diff --git a/eng/Versions.props b/eng/Versions.props
index 8e96ea5ed8..fd71110c9a 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -56,7 +56,7 @@
6.0.0
5.0.1
- 2.0.0-beta5.25210.1
+ 2.0.0-beta7.25365.101
5.0.0
4.5.1
8.0.1
diff --git a/src/Microsoft.Diagnostics.DebugServices.Implementation/CommandService.cs b/src/Microsoft.Diagnostics.DebugServices.Implementation/CommandService.cs
index 89b9a609bd..14251ece7c 100644
--- a/src/Microsoft.Diagnostics.DebugServices.Implementation/CommandService.cs
+++ b/src/Microsoft.Diagnostics.DebugServices.Implementation/CommandService.cs
@@ -276,7 +276,6 @@ private sealed class CommandGroup
{
private Command _rootCommand;
private readonly Dictionary _commandHandlers = new();
- private readonly ParseResult _emptyParseResult;
///
/// Create an instance of the command processor;
@@ -285,10 +284,6 @@ private sealed class CommandGroup
public CommandGroup(string commandPrompt = null)
{
_rootCommand = new Command(commandPrompt);
-
- // The actual ParseResult.Empty() has a bug in it where it tries to get the executable name
- // and nothing is returned under lldb on Linux causing an index out of range exception.
- _emptyParseResult = _rootCommand.Parse(Array.Empty());
}
///
@@ -300,15 +295,7 @@ public CommandGroup(string commandPrompt = null)
/// parsing error
internal bool Execute(IReadOnlyList commandLine, IServiceProvider services)
{
- IConsoleService consoleService = services.GetService();
- CommandLineConfiguration configuration = new(_rootCommand)
- {
- Output = new ConsoleServiceWrapper(consoleService.Write),
- Error = new ConsoleServiceWrapper(consoleService.WriteError)
- };
-
- // Parse the command line and invoke the command
- ParseResult parseResult = configuration.Parse(commandLine);
+ ParseResult parseResult = _rootCommand.Parse(commandLine);
if (parseResult.Errors.Count > 0)
{
@@ -433,14 +420,18 @@ internal void CreateCommand(Type type, CommandAttribute commandAttribute, Func Task.FromResult(ProcessStatus(parseResult.Configuration.Output, parseResult.Configuration.Error)));
+ statusCommand.SetAction((parseResult, ct) => Task.FromResult(ProcessStatus(parseResult.InvocationConfiguration.Output, parseResult.InvocationConfiguration.Error)));
return statusCommand;
}
diff --git a/src/Tools/Common/ProcessTerminationHandler.cs b/src/Tools/Common/ProcessTerminationHandler.cs
index b5eb515f74..c81fb9a799 100644
--- a/src/Tools/Common/ProcessTerminationHandler.cs
+++ b/src/Tools/Common/ProcessTerminationHandler.cs
@@ -24,15 +24,14 @@ internal sealed class ProcessTerminationHandler : IDisposable
internal static async Task InvokeAsync(ParseResult parseResult, string blockedSignals = "")
{
- using ProcessTerminationHandler terminationHandler = ConfigureTerminationHandler(parseResult, blockedSignals);
- return await parseResult.InvokeAsync(terminationHandler.GetToken).ConfigureAwait(false);
- }
-
- private static ProcessTerminationHandler ConfigureTerminationHandler(ParseResult parseResult, string blockedSignals)
- {
- // Use custom process terminate handler for the command line tool parse result.
- parseResult.Configuration.ProcessTerminationTimeout = null;
- return new ProcessTerminationHandler(blockedSignals);
+ using ProcessTerminationHandler terminationHandler = new(blockedSignals);
+ return await parseResult.InvokeAsync(
+ configuration: new InvocationConfiguration
+ {
+ // System.CommandLine should not interfere with Ctrl+C
+ ProcessTerminationTimeout = null,
+ },
+ cancellationToken: terminationHandler.GetToken).ConfigureAwait(false);
}
private ProcessTerminationHandler(string blockedSignals)
diff --git a/src/Tools/dotnet-counters/Program.cs b/src/Tools/dotnet-counters/Program.cs
index b15dca5412..a4dfecc2d2 100644
--- a/src/Tools/dotnet-counters/Program.cs
+++ b/src/Tools/dotnet-counters/Program.cs
@@ -38,7 +38,7 @@ private static Command MonitorCommand()
monitorCommand.TreatUnmatchedTokensAsErrors = false; // see the logic in Main
- monitorCommand.SetAction(static (parseResult, ct) => new CounterMonitor(parseResult.Configuration.Output, parseResult.Configuration.Error).Monitor(
+ monitorCommand.SetAction(static (parseResult, ct) => new CounterMonitor(parseResult.InvocationConfiguration.Output, parseResult.InvocationConfiguration.Error).Monitor(
ct,
counters: parseResult.GetValue(CounterOption),
processId: parseResult.GetValue(ProcessIdOption),
@@ -77,7 +77,7 @@ private static Command CollectCommand()
collectCommand.TreatUnmatchedTokensAsErrors = false; // see the logic in Main
- collectCommand.SetAction((parseResult, ct) => new CounterMonitor(parseResult.Configuration.Output, parseResult.Configuration.Error).Collect(
+ collectCommand.SetAction((parseResult, ct) => new CounterMonitor(parseResult.InvocationConfiguration.Output, parseResult.InvocationConfiguration.Error).Collect(
ct,
counters: parseResult.GetValue(CounterOption),
processId: parseResult.GetValue(ProcessIdOption),
diff --git a/src/Tools/dotnet-dump/Program.cs b/src/Tools/dotnet-dump/Program.cs
index 6e5d18cca7..5b9ab5262b 100644
--- a/src/Tools/dotnet-dump/Program.cs
+++ b/src/Tools/dotnet-dump/Program.cs
@@ -32,8 +32,8 @@ private static Command CollectCommand()
};
command.SetAction((parseResult) => new Dumper().Collect(
- stdOutput: parseResult.Configuration.Output,
- stdError: parseResult.Configuration.Error,
+ stdOutput: parseResult.InvocationConfiguration.Output,
+ stdError: parseResult.InvocationConfiguration.Error,
processId: parseResult.GetValue(ProcessIdOption),
output: parseResult.GetValue(OutputOption),
diag: parseResult.GetValue(DiagnosticLoggingOption),
@@ -60,7 +60,7 @@ private static Command CollectCommand()
private static readonly Option OutputOption =
new("--output", "-o")
{
- Description = @"The path where collected dumps should be written. Defaults to '.\dump_YYYYMMDD_HHMMSS.dmp' on Windows and './core_YYYYMMDD_HHMMSS'
+ Description = @"The path where collected dumps should be written. Defaults to '.\dump_YYYYMMDD_HHMMSS.dmp' on Windows and './core_YYYYMMDD_HHMMSS'
on Linux where YYYYMMDD is Year/Month/Day and HHMMSS is Hour/Minute/Second. Otherwise, it is the full path and file name of the dump."
};
diff --git a/src/Tools/dotnet-sos/Program.cs b/src/Tools/dotnet-sos/Program.cs
index 89a9e3ffc4..d3ab7cfb60 100644
--- a/src/Tools/dotnet-sos/Program.cs
+++ b/src/Tools/dotnet-sos/Program.cs
@@ -32,8 +32,8 @@ private static Command InstallCommand()
};
installCommand.SetAction(parseResult => Invoke(
- parseResult.Configuration.Output,
- parseResult.Configuration.Error,
+ parseResult.InvocationConfiguration.Output,
+ parseResult.InvocationConfiguration.Error,
architecture: parseResult.GetValue(ArchitectureOption),
install: true));
@@ -53,8 +53,8 @@ private static Command UninstallCommand()
description: "Uninstalls SOS and reverts any configuration changes to LLDB.");
uninstallCommand.SetAction(parseResult => Invoke(
- parseResult.Configuration.Output,
- parseResult.Configuration.Error,
+ parseResult.InvocationConfiguration.Output,
+ parseResult.InvocationConfiguration.Error,
architecture: null,
install: false));
diff --git a/src/Tools/dotnet-stack/ReportCommand.cs b/src/Tools/dotnet-stack/ReportCommand.cs
index c8f2ecc365..e0db661c54 100644
--- a/src/Tools/dotnet-stack/ReportCommand.cs
+++ b/src/Tools/dotnet-stack/ReportCommand.cs
@@ -193,8 +193,8 @@ public static Command ReportCommand()
};
reportCommand.SetAction((parseResult, ct) => Report(ct,
- stdOutput: parseResult.Configuration.Output,
- stdError: parseResult.Configuration.Error,
+ stdOutput: parseResult.InvocationConfiguration.Output,
+ stdError: parseResult.InvocationConfiguration.Error,
processId: parseResult.GetValue(ProcessIdOption),
name: parseResult.GetValue(NameOption),
duration: parseResult.GetValue(DurationOption)));
diff --git a/src/Tools/dotnet-stack/Symbolicate.cs b/src/Tools/dotnet-stack/Symbolicate.cs
index ce8b10e59b..7b8081d0c8 100644
--- a/src/Tools/dotnet-stack/Symbolicate.cs
+++ b/src/Tools/dotnet-stack/Symbolicate.cs
@@ -306,8 +306,8 @@ public static Command SymbolicateCommand()
};
symbolicateCommand.SetAction((parseResult, ct) => Task.FromResult(Symbolicate(
- stdOutput: parseResult.Configuration.Output,
- stdError: parseResult.Configuration.Error,
+ stdOutput: parseResult.InvocationConfiguration.Output,
+ stdError: parseResult.InvocationConfiguration.Error,
inputPath: parseResult.GetValue(InputFileArgument),
searchDir: parseResult.GetValue(SearchDirectoryOption),
output: parseResult.GetValue(OutputFileOption),
diff --git a/src/Tools/dotnet-trace/CommandLine/Commands/ConvertCommand.cs b/src/Tools/dotnet-trace/CommandLine/Commands/ConvertCommand.cs
index 055051ae5a..cb12b18081 100644
--- a/src/Tools/dotnet-trace/CommandLine/Commands/ConvertCommand.cs
+++ b/src/Tools/dotnet-trace/CommandLine/Commands/ConvertCommand.cs
@@ -103,8 +103,8 @@ public static Command ConvertCommand()
};
convertCommand.SetAction((parseResult, ct) => Task.FromResult(ConvertFile(
- stdOut: parseResult.Configuration.Output,
- stdError: parseResult.Configuration.Error,
+ stdOut: parseResult.InvocationConfiguration.Output,
+ stdError: parseResult.InvocationConfiguration.Error,
inputFilename: parseResult.GetValue(InputFileArgument),
format: parseResult.GetValue(CommonOptions.ConvertFormatOption),
output: parseResult.GetValue(OutputOption