How to output to console in UWP on Windows 10?

Bad picture Bad · Oct 3, 2015 · Viewed 47k times · Source

Is there a way to write to console / command prompt / powershell (like Console.WriteLine()) or anything similar in UWP apps?

If console is unavailable is there a proper alternative that I can use instead to write to the screen large amounts of text?

I, of course, can make a XAML control and output to it, but it doesn't seem to be convenient in comparison to simple Console.WriteLine().

There is also very old discussion on WPF console, but nothing seems to work from there (at least, I couldn't find Project-Properties-Application tab-Output Type-Console Application and Trace.WriteLine("text") is unavailable).

Answer

Grzegorz Piotrowski picture Grzegorz Piotrowski · Oct 3, 2015

You can use Debug.WriteLine method from System.Diagnostics namespace

MSDN Link

When you start debugging your application those messages will be displayed in the Output Window (Standard VS shortcut is Ctrl+Alt+O, ReSharper shortcut is Ctrl+W, O)