The tracing facility of .NET checks the config file for trace listener definitions, so if you for example want to trace to a file, you've to setup the trace listener in the config file. I'm not aware of a way to define a trace listener in software (not writing one, but activating one
) instead of a config file.