该程序可以在调试模式下工作,但不能在发布模式下工作:
static void Main(string[] args)
{
Trace.Listeners.Add(new TextWriterTraceListener(@"c:\prog\a.txt"));
Debug.AutoFlush = true;
Debug.WriteLine("abc");
Debug.Close();
}
当这个程序在release模式下运行时,它可以正常运行,但是不能在a.txt中写“abc”行你能教我为什么吗?谢谢