If you want to use the VS debugger to get a call stack or dump file of an exception of VS. You can do so with a second instance of Visual Studio. Here is the steps I would use:

1)      Have your working Visual Studio running: let’s call this Visual Studio as VS1.

Proceed to the point right before the exception is about to happen.

2)      Open a second instance of Visual Studio (make sure this is the only second instance): let’s call it VS2.

3)      Setup VS2 debug option as following

a.       Open Tools Option menu

b.      Drill down to Debugging\General, find out the Enable Just My Code (Managed Only) item, and uncheck it.

c.       Drill down to Debugging\Symbols, Set your symbol path to http://msdl.microsoft.com/download/symbols and cache the symbols to local directory like c:\symbols

                       Blog21

d.      Click OK to close down the dialog (note the debugger may take long time to down load the symbols for the first time, once the symbols are cached, it will be faster next time).

4)      In VS2, attach the process of VS1

a)      Open Debug\Attach to process… menu command

b)      In the Attach to Process dialog, Set Attach to parameter by click the Select button (see the picture bellow)

·         Set to Managed code only if you want to debug only managed code (it will be faster to choose the small set of debugging type)

·         Set to Native code only if you want to debug only native code.

·         Set both or automatic if not sure.

If you need to save the dump file, you need to include the native code.

c)      Then double click on the devenv.exe from Available process

 Blog22

Devenv.exe is the visual studio instance.

 

5)      Enable break on exception

a)      In VS2, open Debug\Exceptions menu and check on Common Language Runtime Exceptions for managed code. Add other checks if necessary.

b)      Clock OK to close the dialog.

blog23

      6)      Now go back to VS1, use the VS to allow the exception occur.

7)      You should see the exception captured by VS2.

8)      In VS2, open Debug\Windows\Locals to see the current exception

a)      Make sure the exception is the right one, hit F5 to continue to the next exception if necessary

9)      In VS2, open Debug\Windows\Call Stack to get the call stack window.

a)      Copy the full stack and send back to your Microsoft representative.

10)  Get dump file.

If you include the native code debugging, you can use Debug\Save dump file as menu to save dump file. Send the dump file to Microsoft representative. 

 

 

I am using Visual Studio 2008 as the example above. Other versions should have similar steps.

Also notice that if you have issues regarding crash, hang, slowness, out of memory error, you can collect the information with the performance diagnostic tool available here.