2

I have a simple .NET Core 6 application, developed via Visual Studio Community 2022.

When I press the start button in the standard toolbar, it appends the logs in the output window.

If I want to distinguish the start point of the recent run in the log's lines, I must search in the console.

There is a button in the top corner of the output window for clearing the console before the next run.

My question is, is there any setting in Visual Studio that I can set, to clear this output window automatically in each run before starting logging?

enter image description here

MJBZA
  • 4,796
  • 8
  • 48
  • 97

1 Answers1

0

Here's my cheat-to-win workaround. It's not exactly the same as clearing the output window but it sure gets rid of the noise.

Debug.WriteLine(string.Join(Environment.NewLine, Enumerable.Repeat(string.Empty, 100)));

In the past I would use the technique shown here EnvDTE80.DTE2 to do a legitimate Clear but apparently there's no support for System.Runtime.InteropServices.Marshal.GetActiveObject in net core as mentioned here .Net Framework but not for .Net Core

IVSoftware
  • 5,732
  • 2
  • 12
  • 23
  • Debug.WriteLine(string.Join(Environment.NewLine, Enumerable.Range(0, 100).Select(x => x % 2 == 0 ? "." : string.Empty))); _For environments like Xamarin that suppress "identical lines"._ – IVSoftware Mar 02 '22 at 18:49
  • It's 2022 and still no setting to tick this option?? :-D – Alexander Jan 27 '23 at 20:37