System.Diagnostics.Trace
、System.Diagnostics.EventLog
和 System.Console
似乎都无法使用。WinRT是否包含一个日志记录库?
System.Diagnostics.Trace
、System.Diagnostics.EventLog
和 System.Console
似乎都无法使用。WinRT是否包含一个日志记录库?
我找到的唯一信息是(System.Diagnostics.Debug.WriteLine()):
//
// Summary:
// Writes a message followed by a line terminator to the trace listeners in
// the System.Diagnostics.Debug.Listeners collection.
//
// Parameters:
// message:
// A message to write.
[Conditional("DEBUG")]
public static void WriteLine(string message);
它将写入到Visual Studio输出窗口的调试输出。
System.Diagnostics.Debug.WriteLine()
? - BoltClockhttp://msdn.microsoft.com/en-us/library/windows/apps/aa363752.aspx
您可以在.NET Windows Store应用程序中使用System.Diagnostics.Tracing类(http://msdn.microsoft.com/en-us/library/system.diagnostics.tracing.aspx)。但是,您不能使用它们写入Windows事件日志。
using
语句并尝试访问EventLog
和Console
类,但是 Visual Studio 11 指出它们分别不是System.Diagnostics
和System
命名空间的类。我还认为可能缺少引用,但是“添加引用”对话框中没有可添加的内容。每次调试应用程序时,我会看到加载了 mscorlib。 - Daniel Trebbien