I found a great article explaining how to debug ASP.NET Core 2.0 source code by Steve Gordon:


This got me up and running with the symbol loading, but my problem was that I needed a breakpoint inside the authentication middleware. There was no way for me to put a breakpoint in my code then step into the ASP.NET Core source.

Near the end of Steve's article he says:

Damian mentioned a feature I’d never used where we can set a breakpoint manually from the breakpoint window. I have attempted to set a new function breakpoint up to one of the ASP.NET Core methods but so far I haven’t been able to get it working as Visual Studio states that the source is not available.

I eventually managed to get this working, and here's how.

The code I was interested in was the ValidateCorrelationId method in the RemoteAuthenticationHandler:


To manually add a new breakpoint, open the Breakpoints dialog in Visual Studio and click the New > Function Breakpoint...:

Now let's take a look at the help next to the Function Name input:

I started entering all combinations of namespace, module, brackets with arguments etc trying to get this to work, but always ended up with the following:

Finally, I decided to go simple and look at the very first line in the help above. So I just put the method name and nothing else:

And it worked!

My breakpoint was hit and I could look at the call stack and step through the code.