为什么 Console.WriteLine 在 VS 之外不起作用?

为什么 Console.WriteLine 在 VS 之外不起作用?

问题描述:

我已经创建了 WinForms 应用程序,当我从控制台 (cmd) 运行它时,控制台没有显示我使用 Console.WriteLine 记录的任何内容.它只是挂起",直到程序完成执行.在 VS 中,输出显示了大量信息,包括调试和发布模式.

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?

我很震惊,但执行MyApp.exe > a.log"创建了一个包含我想要的信息的日志文件.

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