// compile with: csc /r:system.dll file_1.cs
using System;
using System.Diagnostics;
class MyClass
{
[Conditional("DEBUG")]
public void VerifyState()
{
Debug.Assert(2 == 0, "Bad State");
}
}
class MainClass
{
public static void Main()
{
Debug.Listeners.Clear();
Debug.Listeners.Add(new TextWriterTraceListener(Console.Out));
MyClass c = new MyClass();
c.VerifyState();
c.VerifyState();
}
}
|