Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you stop linqpad from displaying the output of statements written to Debug.Writeline?

Linqpad seems to put a listener into the debug.listeners collection and then present the outputs of trace to the results window, along side any of the results from the query itself.

Is there a way of telling linqpad not to do this but to leave the existing debug.listeners collection alone?

I have an assembly I'm calling from linqpad which writes trace out to a separate application but it appears that linqpad clears down the listeners and puts its own in, ideally I would like the existing listeners left in tact so I get our normal trace out of the library.

Thanks for any suggestions Tollo

like image 956
Tollo Avatar asked Dec 10 '22 10:12

Tollo


1 Answers

I had the same problem.

I am referencing a third party library (Google.GData.YouTube) that is outputting a bunch of trace information that I don't want. Joe's solution didn't work for me but the question gave me a clue and I worked around the problem by adding the following to my query.

Debug.Listeners[0].Dispose();
like image 190
Peter Avatar answered Dec 11 '22 23:12

Peter