When i’m working with most projects, from winforms, consoles, WPF, if needed i can print out any information i want to check more easily at run time using a messagebox or the likes;
MessageBox.Show(whateveriwannashow);
However, i’m now working on a windows service, which doesn’t allow for the presence of any sort of GUI. What direction should i head in to show some information? Does VS2010 have a built in feature for this sort of stuff?
System.Diagnostics.Trace is your new best friend. Trace is output directly to the output window in Visual Studio, can be send to the logger or can be viewed using free third-party tools like SysInternals DebugView.
For debug work it beats logging hands down. here’s why: