views:

31

answers:

1

Im trying to build an error-logger that loggs running values that is active in the function that caused the error. (just for fun so its not a critical problem)

When going in break-mode and looking at the locals-tab and autos-tab you can see all active variables (name, type and value), it would be useful to get hold of that for logging purposes when an error occur and on some other occasions.

For my example, I just want to find all local variables that are of type string and integer and store the name and value of them.

Is this possible with reflection? Any tips or pointers that get me closer to my goal would be very appreciated.

I have toyed with using expression on a specifik object (a structure) to create an automapper against a dataset, but I have not done anything like what I ask for above, so please make me happy and say its possible.

Thanks.

+1  A: 

If you're looking to reproduce the behavior of the debugger, then you may want to be a debugger. See the Visual Studio Extensibility Learning Center. In particular, see the links under "Debuggers".

John Saunders
+1 for link with plenty of good info. I'll be back...
Stefan