I\'m trying to use System.Diagnostics to do some very basic logging. I figure I\'d use what\'s in the box rather than taking on an extra dependency like Log4Net or EntLib. <
Late joining with a quick footnote about the app.config, in case this saves a couple of days from the life of someone out there:
Assume you have the startup (.exe) projectA containing classA which makes use of projectB (.dll) containing classB.
ClassB in turn makes use of a new TraceSource("classB") instance. In order to configure it you need to modify the app.config or projectA. Tweaking the app.config of projectB won't lead anywhere.
Also note that the placement of the
Section inside app.config seems to be causing problems if placed before the section:
or after the section:
At least in my case, I was getting errors when I attempted to place it in these locations in the app.config of my project. The layout that worked for me was:
...config sections here if any...
...runtime sections here if any...
...usersettings sections here if any...