debugging - C#: Enumerating SessionState keys in QuickWatch window -
while debugging in visual studio 2010, there way view keys of httpsessionstate in quickwatch window?
there must better method exiting debugging session, coding loop on session.contents.keys object, breakpointing , stepping through loop - see keys defined.
i suspect i'm going in entirely incorrect manner. , hints or advice appreciated.
httpsessionstate ienumerable, long system.core dll loaded in process you're debugging, can evaluate system.linq.enumerable.toarray(system.linq.enumerable.cast<object>(myhttpsessionstate)) in quickwatch window. if current code file has using system.linq statement, can write shorter expression: myhttpsessionstate.cast<object>().toarray()
if you're having @ httpsessionstate objects often, may want try bugaid, , define above expression custom expression on httpsessionstate class, won't forced type in long expression each , every time.
full disclosure: i'm co-creator of bugaid.
Comments
Post a Comment