使用Trace.WriteLine在Windows Store應用程序,我可以使用:不能在Windows Store應用
System.Diagnostics.Debug.WriteLine("Test");
但隨着Trace
更換Debug
提供了以下錯誤:CS0103: The name 'Trace' does not exist in the current context
我怎樣才能解決這個問題?
使用Trace.WriteLine在Windows Store應用程序,我可以使用:不能在Windows Store應用
System.Diagnostics.Debug.WriteLine("Test");
但隨着Trace
更換Debug
提供了以下錯誤:CS0103: The name 'Trace' does not exist in the current context
我怎樣才能解決這個問題?
WinRT沒有跟蹤,並且它沒有跟蹤監聽器。 Debug.WriteLine
是最好的,你可以做,而不訴諸像metrolog第三方。
如果你的問題是很多現有的代碼參照Trace.
你可以別名Debug
爲Trace
與
using Trace = System.Diagnostics.Debug;
的WinRT沒有'Trace',而且缺乏跟蹤偵聽器。無需使用[metrolog](https://github.com/mbrit/metrolog)等第三方,Debug.WriteLine就是最好的選擇。 – vcsjones 2013-05-13 13:01:19
@vcsjones你應該將評論提升爲答案:) – 2013-05-13 14:22:47