Display a string in the Output Window in Visual Studio

You can use the Debug.WriteLine method that is defined in the System.Diagnostics namespace to display the string in the Visual Studio output window as shown.

How to display a string in the Output Window in Visual Studio ?

static void Main(string[] args)
{
    System.Diagnostics.Debug.WriteLine("This is shown in the Output Window");
    Console.ReadLine();
}

Leave a Reply