Reputation: 45096
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
Upvotes: 0
Views: 268
Reputation: 941724
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.
Upvotes: 3