Is it possible to set a breakpoint in anonymous functions?
C#Visual Studio-2010LambdaAnonymous FunctionC# Problem Overview
I quickly want to determine whether/when a set of events are triggered. Therefore I quickly assigned empty lambda's to them.
_session.TopologyStarted += () => { };
When tracing through the code when the event is triggered, the debugger goes into the anonymous function, allowing to debug it's execution. However, when setting a breakpoint on this line of code, a breakpoint is set on the assignment of the anonymous function to the event.
Is there a way to set a breakpoint within the anonymous function?
C# Solutions
Solution 1 - C#
Put your cursor in the anonymous function (between the {}'s) and press F9.