In the Windows Store app, I can use:
System.Diagnostics.Debug.WriteLine("Test");
But instead of replacing Debug with Trace , the following error appears: CS0103: The name 'Trace' does not exist in the current context How can I fix this?
Debug
Trace
CS0103: The name 'Trace' does not exist in the current context
WinRT does not have Trace, and it lacks trace listeners. Debug.WriteLine is the best thing you can do without resorting to something by a third party, such as metrolog .
Debug.WriteLine
If your problem has a lot of existing Trace. related code Trace. You can alias Debug as Trace with
Trace.
using Trace = System.Diagnostics.Debug;