Fix issue where DmlExec isn't implemented in Repl (#3794)
authorLee Culver <leculver@microsoft.com>
Thu, 30 Mar 2023 22:52:22 +0000 (15:52 -0700)
committerGitHub <noreply@github.com>
Thu, 30 Mar 2023 22:52:22 +0000 (15:52 -0700)
* Fix issue where DmlExec isn't implemented in Repl

WriteDmlExec is meant to work even if DML is disabled, but the Repl project throws NotSupportedException instead of passing the text argument.

* Write the raw output when DML is present

Also print output when WriteDml is called.  This shouldn't happen in the current codebase, but at least it won't cause the command to stop.

src/Microsoft.Diagnostics.Repl/ConsoleService.cs

index be30dc8671c0a3d701eb9e4e5ceab1f9409a3fa0..06aaf7b478e1821ea42386ac8b04ce3059b70a18 100644 (file)
@@ -589,9 +589,9 @@ namespace Microsoft.Diagnostics.Repl
 
         bool IConsoleService.SupportsDml => false;
 
-        void IConsoleService.WriteDml(string text) => throw new NotSupportedException();
+        void IConsoleService.WriteDml(string text) => WriteOutput(OutputType.Normal, text);
 
-        void IConsoleService.WriteDmlExec(string text, string _) => throw new NotSupportedException();
+        void IConsoleService.WriteDmlExec(string text, string _) => WriteOutput(OutputType.Normal, text);
 
         CancellationToken IConsoleService.CancellationToken { get; set; }