Why is Console.WriteLine doesn't work outside

2019-08-05 06:50发布

I have created WinForms app, when I run it from console (cmd) the console is does not show anything I have logged using Console.WriteLine. It just "hangs" until the program has finished execution. In VS the Output shows a lot of informations, both in Debug and Release mode.

I was hopeing to use console and tracing tool and later be able to determine why something did not work on some outside environment. How to enable that in Console?

2条回答
ら.Afraid
2楼-- · 2019-08-05 07:38

I was shocked but doing "MyApp.exe > a.log" has created a log file with information I wanted.

查看更多
三岁会撩人
3楼-- · 2019-08-05 07:45

You may want to see if redirecting the console error output like this suggests will work for you. Or you could use Log4Net like @Mitch Wheat suggested

查看更多
登录 后发表回答