Cannot use Trace.WriteLine in a Windows Store app

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?

+7
source share
2 answers

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 .

+10
source

If your problem has a lot of existing Trace. related code Trace. You can alias Debug as Trace with

 using Trace = System.Diagnostics.Debug; 
0
source

All Articles