5

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

Tollo
  • 505
  • 4
  • 14

2 Answers2

8

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();
Perception
  • 79,279
  • 19
  • 185
  • 195
Peter
  • 81
  • 1
  • 1
6

If you go to Edit | Preferences | Advanced, and select 'Always use fresh app domains', does it make any difference?

Joe Albahari
  • 30,118
  • 7
  • 80
  • 91
  • That worked, it no longer seems to either disable our trace listeners or put the output into the results window :) I set Always Use Fresh Application Domains to true. Not sure what that does but it seems to work. Thanks. – Tollo Mar 10 '11 at 10:02