Recently I’ve been asked to investigate a number of issues involving the Tombstone state. During the investigations I was using the ‘Tombstone upon deactivation’ and I was experiencing a number of lost connections between Visual Studio and the emulator/device. What I didn’t appreciate was these disconnections are almost always caused by a simple exception in the application. I.e. the app was failing because of a null exception which was causing the debugger to disconnect rather than break(). So my tips are;
- If you get a disconnect, place breakpoints at positions *before* you expect to hit a problem area, do not rely on Visual Studio break-pointing and showing you the exception
- Once you have a disconnect you will probably have to un-install the app from the emulator/device otherwise Visual Studio may not reconnect [Edit] I’ve also found that just directly launching the app from the emulator and then restarting the debug session also works. [Edit 2] Also engaging the lock-screen can also clear the problem. [Edit 3] Actually I think it’s just about waiting for a bit!
- Test for Tombstone, it still exists!