Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

visual studio debugging - Console.WriteLine does not output to Output Window in VS 2017

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

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 ).

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

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

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 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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...