You can use Debug.WriteLine
.
You can configure your application to use the ConsoleTraceListener
:
To direct all trace and debug
messages to the console while the
application executes, add a
ConsoleTraceListener object to the
application configuration file. Edit
the configuration file that
corresponds to the name of your
application, or the app.config file in
a Visual Studio 2005 project. In this
file, insert an element for a
ConsoleTraceListener.
The following example adds a
ConsoleTraceListener object named
configConsoleListener to the Listeners
collection.
<configuration>
<system.diagnostics>
<trace autoflush="false" indentsize="4">
<listeners>
<add name="configConsoleListener"
type="System.Diagnostics.ConsoleTraceListener" />
</listeners>
</trace>
</system.diagnostics>
</configuration>
Then you can call Debug.WriteLine
and it will log to the output console.