77

Using LINQPad, using the extension method Dump(), Console.WriteLine or Debug.Writeline, the values will appear in the results window.

Is there a way to clear this results window during the run of a linqpad script? As an example, I tried Console.Clear() however this throws an exception

1 Answer 1

138

I've added a feature to do this

Util.ClearResults();
3
  • How about implementing a progress spinner writing to the console ? I tried to do a Console.Write and Console.Clear() which gave an error. Switching to Util.ClearResults in a tight loop with Thread.Sleep of 100 ms between each iteration to "rotate" the console spinner, gave no output at all using Util.ClearResults .. May 9, 2020 at 22:30
  • 1
    LINQPad lets you dump progress bars: share.linqpad.net/rx7h34.linq . You can implement a spinner as follows: share.linqpad.net/av2a4w.linq May 11, 2020 at 0:46
  • For the second snippet (spinner one), I got 'Util' does not contain a definition for 'HtmlHead' error message. Seems like the second snippet only works on v7.x Jun 22, 2022 at 4:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.