I am using Microsoft Visual Studio 2010 Professional and developing an asp.net / C# app.
While in debug mode I can see the local variables under the “Locals” tab, and there is also something called “this” which expands into multiple tree structures.
However, I am unable to find my Session variables name / value pair anywhere.
A friend suggested I use the “Immediate Window” tab and type the name of my Session variable (ie.,Session[“SomeValue”] and press enter. This does give me the value of the Session variable. This is simple enough for a single session variable but when dealing with multiple variables it becomes a bit cumbersome.
Is there anyway that I can just browse to a section that stores the key / value pair for all my session variables, like I can for the local variables?
There might be a more elegant way, but if I recall you can dump out Session name/value pairs when tracing is enabled.
~/Trace.axdIn web.config
http://msdn.microsoft.com/en-us/library/bb386420.aspx
Of course, this is only useful when there is a meaningful string representation of the object.
You could also look at writing a custom visualizer (I believe that’s the correct term) that lets you inspect a type using your own custom functionality. I’ve seen this done for inspecting dynamic methods and it is quite useful, though I imagine it would be some effort to write one.