0

Can I get Visual Studio to break on any Debug.WriteLine?

I have a Debug.WriteLine that is just writing a number and I cannot find it to turn it off.

I have it down to one method call but even holding F11 for 20 minutes did not get to the mutant Debug.WriteLine

2

1 Answer 1

3

Use Debug > New Breakpoint > Break at Function. Enter "System.Diagnostics.Debug.WriteLine" for the function name. That sets 5 breakpoints, one for each overload.

Do consider that it might not be generated by managed code, the default trace listener that normally displays Debug.WriteLine() output uses a debugger function (OutputDebugString) to produce output. That function may also be used by native code.

3
  • Thanks - that found it. Now how do I delete THAT BreakPoint? If I have to delete all then cool - but would like to keep my manual BreakPoints.
    – paparazzo
    Apr 25, 2015 at 16:01
  • Use Debug > Windows > Breakpoints to manage your breakpoints. Apr 25, 2015 at 16:04
  • Thanks again. You are 541K for a reason. Now I have a delay with symbols loading that I never had before. But I can open another question.
    – paparazzo
    Apr 25, 2015 at 16:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.