System.Diagnostics.Debug.WriteLine 用于跟踪。
有趣的是,C:\Users\Public\Documents\UserNameFromProgramContext\ProgramName.asserts 文件是在我的机器上创建的,但不是在其他开发人员的机器上创建的。
我只想在 VS 的输出窗口中输出 Debug.WriteLine。
哪里可以配置Debug.WriteLine写入的地方?
请您参考如下方法:
简单:
Debug.Listeners.Add(new TextWriterTraceListener("c:\\temp\\test.txt"));
Debug.AutoFlush = true;
Debug.WriteLine("test");
所以只需使用 Listeners 集合来操作调试数据写入的位置
