23

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.

MarcioAB
  • 551
  • 1
  • 3
  • 11
  • 2
    Possible duplicate of [Writing to output window of Visual Studio?](http://stackoverflow.com/questions/9466838/writing-to-output-window-of-visual-studio) – Imran Saeed Mar 20 '17 at 15:37
  • That post is more toward the Debug.Writeline, that 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. – MarcioAB Mar 20 '17 at 16:50
  • Just discovered 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. In VS 2017 there is no such enabler. So, I'm assuming my old code will only run in VS 2015 ... :( – MarcioAB Mar 20 '17 at 18:18
  • Also discovered that Trace (System.Diagnostics) outputs to Output Window in Release configs. – MarcioAB Mar 20 '17 at 19:16

1 Answers1

21

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.

MarcioAB
  • 551
  • 1
  • 3
  • 11
  • 1
    since this issue has been resolved, please mark it as the answer, so it could help other members who meet the same issue as yours, thanks for your sharing. – Jack Zhai-MSFT Mar 29 '17 at 05:41
  • @MarcioAB - Do you have links to Microsoft docs which show this? This was working fine for me until I recently updated. – Kitson88 May 05 '17 at 13:04
  • 2
    No (I can not find the links anymore, but they were no Microsoft docs). Working fine in VS2015 and not working anymore in VS2017 ? (by the way that is the context in here). – MarcioAB May 07 '17 at 13:52
  • 6
    No, it should not be closed, replacing "Console." by "Trace." is not a good solution. Remember that the new standard is that everything should go to console/stdout. I do not understand why VS2017 cannot support this. – mattias Apr 02 '18 at 11:47
  • Maybe this can help - https://developercommunity.visualstudio.com/content/problem/46776/c-consolewriteline-no-longer-outs-to-vs-output-win.html – Mauricio Gracia Gutierrez Nov 16 '18 at 16:53