How to clean the Visual Studio Output Window?

0

I'm writing an application that uses the debug class to write to the VS Output screen.

I just want to clean the contents of this screen through my code, because after a while it gets very polluted. Is this possible and recommended (as I find it strange not to have a clear method for this class)?

    
asked by anonymous 06.01.2018 / 18:29

1 answer

0

Source: link

// Import EnvDTE and EnvDTE80 into your project
using EnvDTE;
using EnvDTE80;

protected void ClearOutput()
{
    DTE2 ide = (DTE2)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.12.0");
    ide.ToolWindows.OutputWindow.OutputWindowPanes.Item("Debug").Clear();
    System.Runtime.InteropServices.Marshal.ReleaseComObject(ide);
}
    
12.01.2018 / 13:43