为什么 Console.WriteLine 在 VS 之外不起作用? [英] Why is Console.WriteLine doesn't work outside of VS?

查看:28
本文介绍了为什么 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.

这篇关于为什么 Console.WriteLine 在 VS 之外不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆