调试异步代码时“跳过”断点

web*_*orm 4 c# debugging async-await

我有一些代码返回以下异常...

Object reference not set to an instance of an object

我试图进一步深入研究以找出原因,但是当我在调用代码之后设置断点时,断点似乎被传递了..

PaymentProcessor pp = new PaymentProcessor();
List<string> results = await pp.ProcessPayment();
foreach (string result in results)  // Break-point set here
{
   ...
}
Run Code Online (Sandbox Code Playgroud)

我想看看方法调用的结果是否返回任何results. 我认为这与使用方法有关async await。如果由于异步方法而跳过断点,我该如何停止它?我使用async代码来释放 UI 线程。

更多细节 ....

异常冒泡的代码是..

var paymentTask = GetPaymentUpdates();
paymentTask.Wait(); // Object not set exception occurs here.
Run Code Online (Sandbox Code Playgroud)

Joh*_*ner 5

如果方法中抛出异常,则该代码将被跳过ProcessPayment,因此它永远不会到达该代码。