I'm working on some code that uses the System.Diagnostics.Trace class and I'm wondering how to monitor what is written via calls to Trace.WriteLine() both when running in debug mode in Visual Studio and when running outside the debugger.
dotnet-trace collect. Collects a diagnostic trace from a running process or launches a child process and traces it (. NET 5+ only). To have the tool run a child process and trace it from its startup, append -- to the collect command.
Tracing helps to see the information of issues at the runtime of the application. By default Tracing is disabled. Tracing has the following important features: We can see the execution path of the page and application using the debug statement. We can access and manipulate trace messages programmatically.
Tracing is a feature in Visual Studio that allows the programmer to put a log message onto the main output window. The mechanism is fairly simple to use. It is only active with debug builds, in a release build none of the trace messages will be displayed.
Try Debug View. It works quite nicely.
I use a simple little program called 'BareTail' which displays plain text files, updating it's display as the file gets written to and follows (or wraps) to the bottom of the file.
When running outside the debugger you'll need to attach a file-writer to write out the trace information, which you can do by adding a few lines to the .exe.config file
Hope that Helps ;o)
Have a look at DevTracer. It also allows monitoring a .NET application remotely.
DISCLAIMER: I am the developer of DevTracer and therfore my opinion may not be neutral.
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