I have a code like this:
private async Task<string> GetToken()
{
try
{
response = await nugetPackage.SomeMethod();
int x = 5;
x++;
}
catch (Exception)
{
throw;
}
return response.Token;
}
When I try to debug this process, the breakpoint hits the following line:
response = await nugetPackage.SomeMethod();
but it just vanishes beyond that point, i.e., nothing happens on pressing f10. It never reaches
int x = 5;
There is a breakpoint in the catch statement as well which is not being hit either.
The GetToken method is called thus:
var rawToken = await GetToken();
I thought await meant that the main thread would not be blocked so the breakpoint should have hit the next line? What could be the potential explanation for this?