0

Imagine I have some codes that call a third-party library to do something and the library calls my code which I provided on configuration to achieve what intended to.

Now I want the debugger to break automatically on the next line of my code when the third-party called. (Is there any feature?)

I know I can put a breakpoint on my code which passed to the third-party library but Imagine there are numerous codes that makes it really hard to find that configuration.

And step into on debugging is not an option because the third-party library is so complicated.

Any solution on visual studio or Rider or any other IDE would be acceptable.

qazwsx123
  • 161
  • 1
  • 11
  • There is [DebuggerStepThroughAttribute](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.debuggerstepthroughattribute), which prevents debugger to step over the methods. I guess debugger won't be able to step over if sources are not available. Otherwise just [step over + step out](https://learn.microsoft.com/en-us/visualstudio/debugger/navigating-through-code-with-the-debugger?#step-through-code) is the only way. – Sinatr Jul 14 '21 at 07:30
  • I believe so, you call 3d party library and want to skip external code completely, stopping debugger at the next line after call. Right? – Sinatr Jul 14 '21 at 08:02
  • @Sinatr If the library assess OP's configuration somewhere under the call tack, wouldn't step over skip that as well? – HardcoreGamer Jul 14 '21 at 08:17
  • @HardcoreGamer, good question, now I see the problem. What is configuration? If it's passed into library, then perhaps OP can create a fake instance and [rise breakpoint](https://stackoverflow.com/q/361468/1997232), when its is accessed? – Sinatr Jul 14 '21 at 08:28
  • Why are there so many callbacks to your code? In my experience such things are fairly rare, and it should be possible to predict what callbacks are called or what events are raised when calling a library method. – JonasH Jul 14 '21 at 09:34

0 Answers0