I have defined a Trace Listener on my console application like this
ConsoleTraceListener = new ConsoleTraceListener();
AutoFlush = true;
Listeners.Add(traceListener);
And then several Trace.TraceInformation
calls through all my source code.
The point is that when I execute the code on the command line, I can see the following thing on each of the Traces:
- MyNewSampleProject.vshost.exe Information: 0 : Starting...
- MyNewSampleProject.vshost.exe Information: 0 : Creating Profile...
How can I get rid of the
MyNewSampleProject.vshost.exe Information: 0:.
I am just interested in knowing the message that I set in the Trace.
Thanks!
Unfortunately this seems not possible.
I decompiled that listener and found, that there is no option to this. But there's still hope.
You can implement your own Listener like this: