Console.WriteLine 不会输出到 VS 2017 中的输出窗口 [英] Console.WriteLine does not output to Output Window in VS 2017

查看:50
本文介绍了Console.WriteLine 不会输出到 VS 2017 中的输出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简而言之:Console.WriteLine 在 VS 2015 中工作正常,但在 VS 2017 中不再工作.

In short: Console.WriteLine was working ok in VS 2015 but it is not working anymore in VS 2017.

详细说明:我有一些使用 Console.Write 的 VB 代码在 VS 2015 中输出 ok 到输出窗口,即使配置为 Release(与 Debug 对比)启动时启动调试(与 Start without Debugging 相比).

In detail: I have some VB code using Console.Write that outputs ok to Output Window in VS 2015, even when configured as Release ( to contrast with Debug ) launched with Start Debugging ( in contrast with Start Without Debugging ).

今天我升级到 VS 2017(社区版),但 Console.Write 在与 VS 2015 相同的条件下不再工作.

Today I upgraded to VS 2017 ( Community version ), but the Console.Write is not working anymore in the same conditions as VS 2015.

也许我过去在 VS 2015 中做了一些配置,但我不记得了.

Maybe I made some config in VS 2015 in the past, but I do not recall.

有人可以帮助我如何在相同的条件下使 Console.Write 输出到输出窗口(使用开始调试启动的发布配置).

Can someone help me how to make Console.Write output to Output Window in the same conditions ( Release config launched with Start Debugging ).

Obs:当您处于调试配置中时,Debug.Writeline 工作正常(输出到输出窗口).当您处于发布配置中时,即使您使用开始调试"启动,Debug.Writeline 也不会输出(到输出窗口).需要(以及问题)是在发布配置中开始调试的上下文中.

Obs: Debug.Writeline works ok ( output to Output Window ) when you are in a Debug configuration. When you are in a Release config, Debug.Writeline, does not output (to Output Window) even if you launch with Start Debugging. The need (and so the question) is in the context of Start Debugging in a Release config.

推荐答案

VS 2017(社区)没有 VS 2015 中的托管进程".在 VS 2015 中,可以在项目属性的调试面板中启用托管进程".通过托管进程",可以使用 Console.WriteLine() 输出到输出窗口(在使用 Start Debugging 启动发布配置时).在 VS 2017 中没有这样的启用程序,因此 Console.WriteLine() 不再输出到输出窗口.

VS 2017 ( Community ) does not have "Hosting Process" as in VS 2015. In VS 2015 the "Hosting Process" can be enabled in the Debug panel of the Project Properties. With the "Hosting Process" is possible to output to Output Window ( when launching a Release config with Start Debugging ) using Console.WriteLine(). In VS 2017 there is no such enabler and so the Console.WriteLine() does not output to Output Window anymore.

发现 (System.Diagnostics.)Trace.WriteLine(Format(...)) 输出到 Release configs 中的 Output Window 并且可以替换 (System.)Console.WriteLine.

Discovered that (System.Diagnostics.)Trace.WriteLine(Format(...)) outputs to Output Window in Release configs and can replace (System.)Console.WriteLine.

这篇关于Console.WriteLine 不会输出到 VS 2017 中的输出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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