4

We are starting to use SourceLink V2 on a project for debugging our internal nuget packages. We have it set up properly (as best as we can tell) and are able to successfully debug into normal, synchronous methods.

Unfortunately, much of our code is written asynchronously (using async/await). When we try to step into any methods that are awaitable, the compiler skips right over the line. I have confirmed that the PDB is available and the source code is embedded into the PDB using "dotnet sourcelink print-urls [path.pdb]".

Is this a known limitation? If so, is there a workaround of some sort to allow for this type of debugging? Has anyone successfully debugged asyncronous libraries using SourceLink?

Geoff Brown
  • 111
  • 3

1 Answers1

1

Not sure about SourceLink, but in C# code debugging with Async methods is possible: https://msdn.microsoft.com/en-us/library/jj155813.aspx?f=255&mspperror=-2147217396#Anchor_1

When you await a Task, code execution will jump out of the current function and yield control to its caller. Then at some point later in time after the awaited Task finishes, it will jump back to execute code after the await statement.

BTW, on a nested function call, Step Into steps into the most deeply nested function. If you use Step Into on a call like Func1(Func2()), the debugger steps into the function Func2. The debugger actually steps through code statements rather than physical lines. For example an if clause can be written on one line.

Fletcher
  • 422
  • 1
  • 6
  • 21