console.writeline within Task does not work

天大地大妈咪最大 提交于 2019-12-11 10:16:03
问题 I am learning task aysny based programing and cannot get to make this code work. The console prints the message only once and then disappears. if I remove the read line and run the program(not debug mode) the console just appears with message saying press a key to continue. When I debug and put the debugger in console.write then it works fine for some time and then the console window disappears and restarts again. If I use for loop <10000 instead of while then also the behaviors is same Could