I have an application with a String variable that repeated gets a Date from a database, does something with that field, then goes onto the next row.
Is there a way I can send send out some debugging information to the stdout console so I can debug better/view the progress of the program?
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.
System.Console.WriteLine will also do the trick.
Documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With