Another debugging topic today. And another look at Watch window ๐ in Visual Studio. Using it, we can observe values of our variables while the code is running but sometimes that's not enough. We can use pseudo variables.
The documentation ๐ is attached as an image down below ๐ but it doesn't contain the full list.
๐ $exception is probably the most know one; it holds the last thrown exception
๐ $returnvalue holds the result of the function right after we exit
๐ $asyncStateMachine - the state machine object, available inside async method
๐ $threadSmallObjectHeapBytes, $threadUserOldHeapBytes - give an info about how much bytes were allocated by the current thread
๐ See the docs: https://learn.microsoft.com/en-us/visualstudio/debugger/pseudovariables?view=vs-2022
#dotnet #visualstudio #debugger #watchwindow