Console.WriteLine does not show up in Output window

后端 未结 9 1429
梦毁少年i
梦毁少年i 2020-12-07 19:49

I have put some Console.WriteLine calls in to test, but they aren\'t appearing in the output box?

public static ArrayList myDeliveries = new Arr         


        
9条回答
  •  北荒
    北荒 (楼主)
    2020-12-07 20:33

    If you intend to use this output in production, then use the Trace class members. This makes the code portable, you can wire up different types of listeners and output to the console window, debug window, log file, or whatever else you like.

    If this is just some temporary debugging code that you're using to verify that certain code is being executed or has the correct values, then use the Debug class as Zach suggests.

    If you absolutely must use the console, then you can attach a console in the program's Main method.

提交回复
热议问题