How to debug asp.net core async method using Source Link?
Asked Answered
H

0

9

I am trying to debug asp.net core internals to see what is going on under the hood.

I set up .net core debugging in VS Code according to this article: https://github.com/OmniSharp/omnisharp-vscode/wiki/Debugging-into-the-.NET-Framework-itself

Now I get .net core sources automatically while debugging and can step into methods, but not async ones. Since I have no source code at hand (it loads on the fly from somewhere) I cannot set a breakpoint in an async method to make debugger stop there.

I have the following controller method. How can I step into HttpContext.SignInAsync(...) method in VS Code debugger?

public async Task<IActionResult> Login(LoginModel model)
{
    ...
    await HttpContext.SignInAsync(principal);
    ...
}

Update #1

Same thing for Visual Studio 2019. So it does not matter if I use VS Code or VS 2019.

Hekking answered 26/4, 2019 at 8:17 Comment(1)
I'm also experiencing this issue. When stepping into an async method, the debugger steps into the internal state machine and not the method itself.Earnestineearnings

© 2022 - 2024 — McMap. All rights reserved.