Disable Just My Code¶
Turn off Visual Studio's Just My Code feature.
With it on, the debugger steps over framework code. This includes IObservable<T> pipelines and async/await
state machines. So Step Into on a WhenAnyValue or Subscribe call skips straight past it. Turning it off
lets you step through the framework's own code. That is where most reactive bugs actually show up.
See debugging ReactiveUI for the full set of debugger settings SourceLink needs, including this one.
Break on first-chance exceptions¶
Reactive debugging tip: turn on breaking on thrown exceptions before they are handled.
In Visual Studio, when exceptions are thrown or end up unhandled, the debugger can help you debug these by breaking just like it breaks when a breakpoint is hit. In this blog post we will look at the different classifications of exceptions and how to configure when the debugger will break for those exceptions.
Understanding exceptions while debugging with Visual Studio
An exception inside a stream's callback ends that subscription. The stream calls OnError instead of OnNext
or OnCompleted, and it stops. Break on the exception itself, rather than after it becomes an unhandled error.
That puts you at the exact line that failed.