Debugging async methods

Answered

Given this code:

class Program
{
static async Task Main(string[] args)
{
int contextVariable = 1;
await Task.Delay(100);
int contextVariable2 = 2;
await Task.Delay(100);
ThrowException();
Console.WriteLine("Hello World!");
}

static void ThrowException()
{
throw new Exception();
}
}

There is no way to see the value of `contextVariable` and `contextVariable2` after the exception is thrown. This is normally possible without async methods.

0
2 comments

This problem doesn't exist in Visual Studio. 

Also I found this relating issue on issue tracker:

https://youtrack.jetbrains.com/issue/RIDER-28264

I wonder why Jetbrains doesn't fix these important issues after 9 MONTH.

What is more important than debugging in an IDE?

0

Hi,

Thank you for the request and the sample code.
I will draw developers' attention to this issue.

 

Kind regards,

Sofia.

0

Please sign in to leave a comment.