简体   繁体   English

Visual Studio输出窗口不会更新

[英]Visual Studio Output Window does not update

The output window in Visual Studio does not seem to be updating. Visual Studio中的输出窗口似乎没有更新。 When I manually switch the "Show output from" to any other option, then back to "Debug" it refreshes but otherwise, it does not refresh on its own. 当我手动将“显示输出自”切换到其他任何选项,然后又回到“调试”时,它会刷新,但是不会单独刷新。 Does anyone know why this is occurring. 有谁知道为什么会这样。

The commands System.Diagnostics.Debug.WriteLine() and SystemDiagnostics.Trace.WriteLine() both result in the same problem. 命令System.Diagnostics.Debug.WriteLine()SystemDiagnostics.Trace.WriteLine()都导致相同的问题。

Are you familiar with Application.DoEvents(); 您是否熟悉Application.DoEvents();

Putting this immediately after your .WriteLines(); 将其立即放在您的.WriteLines();之后; will allow the program to dispatch window events, otherwise you're simply going to see 'Not Responding' at the top of the screen. 将允许该程序调度窗口事件,否则您将只是在屏幕顶部看到“无响应”。 However, if you're displaying something in the interior of a detail loop, this will slow things down a lot. 但是,如果要在详细信息循环的内部显示某些内容,则会使速度大大降低。 When it repaints the Trace screen, it's refreshing the entire window, not simply the line you just wrote. 当重新绘制“跟踪”屏幕时,它将刷新整个窗口,而不仅仅是刷新您刚刚编写的行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM