Unfortunately there is no way to do this with the C# EE. The names for these locals are indeed stored in the PDB and available. However the C# EE will filter out all temporary values during debugging to reduce clutter. This filtering is unconditional and cannot be overridden. C# is not alone here as this is the behavior in every language.
The good news though is that every language uses different naming patterns for their temporaries. This means a temporary name in C# will run right past the filtering of the VB EE. Even though it's an illegal identifier the VB EE still considers it a valid local (and vice versa). Hence you just need to temporarily switch the debugging engine for C# code to the VB EE and the locals will become visible
Here is how to do this
- Close all instances of Visual Studio (this is really important)
- Open up regedit
- Navigate to
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0_Config\AD7Metrics\ExpressionEvaluator\{3F5162F8-07C6-11D3-9053-00C04FA302A1}\{994B45C4-E6E9-11D2-903F-00C04FA302A1}
- Change the value of CLSID from
{60F5556F-7EBC-4992-8E83-E9B49187FDE3}
to {59924502-559A-4BB1-B995-5D511BB218CD}
Now whenever you debug C# code it will use the VB EE and hence display temporaries as normal locals. Note that this is completely unsupported. But it should work fine. I was able to see raw closure values with this trick on my machine and poke around a bit without any issues.
Note that these instructions are specific to Visual Studio 2013. If you are using 2012, or 2010 it should work by changing the 12.0_Config in the registry key name to
- 2012 use 11.0_Config
- 2010 use 10.0_Config
It may need a few tweaks on top of that (didn't actually test older versions). If you run into any problems there let me know and I'll try and get it working locally and update the instructions
Here is a pic of the final output once you make this change
