2013-05-13 63 views
7

使用Trace.WriteLine在Windows Store應用程序,我可以使用:不能在Windows Store應用

System.Diagnostics.Debug.WriteLine("Test"); 

但隨着Trace更換Debug提供了以下錯誤:CS0103: The name 'Trace' does not exist in the current context我怎樣才能解決這個問題?

+2

的WinRT沒有'Trace',而且缺乏跟蹤偵聽器。無需使用[metrolog](https://github.com/mbrit/metrolog)等第三方,Debug.WriteLine就是最好的選擇。 – vcsjones 2013-05-13 13:01:19

+1

@vcsjones你應該將評論提升爲答案:) – 2013-05-13 14:22:47

回答

10

WinRT沒有跟蹤,並且它沒有跟蹤監聽器。 Debug.WriteLine是最好的,你可以做,而不訴諸像metrolog第三方。

0

如果你的問題是很多現有的代碼參照Trace.你可以別名DebugTrace

using Trace = System.Diagnostics.Debug; 
相關問題