Debug tips

For those unfamiliar with Visual Studio here are some tips that might be helpful.

First, if you run an app under debug on the device and want to stop debugging yet leave the code on the device running, just select Debug β†’ Detach All

image

You can do this if the code was actively executing or stopped at a breakpoint.

To see all of the loaded .Net assemblies when debugging, use Debug->Windows->Modules

This is useful with code that dynamically loads assembles and lets you verify that the version you expect to be loaded is in fact the one that’s loaded. You can also see the address where the assembly was loaded too:

image

If you want to examine raw memory, use Debug->Windows->Memory then you can have up to four independent memory windows to pick from:

Finally, Debug->Windows->Exception Settings lets you drill down into the exception namespaces and select specific exceptions that will cause the debugger to break when the exception is thrown. There are many situations where exceptions are thrown and handled silently which can be confusing sometimes, this lets you see and debug as soon as the exception is thrown before any catch blocks run.

3 Likes

Good call on the note on checking loaded assemblies