views:

96

answers:

1

Hello, How can I catch an error in devenv? If an error occures (the build fails..) I need to print it out. How can I do that? Thanks!

A: 

If it really is an exception then you can open a second Visual Studio process and use it to debug the first VS process.

  1. Open up the first Visual Studio (the one that will have an exception)
  2. Open up another instance of VS and go to Tools / Attach to Process
  3. Select the only available devenv.exe in the list (the "current" devenv.exe will be grayed out or unavailable, so don't worry about selecting the wrong one)
  4. Click Attach
  5. Go to Debug / Exceptions and click all the checkboxes so that they are all enabled (there should be 10 checkboxes)
  6. Go back to the first VS and reproduce the error

Hopefully the second VS will stop when the error occurs. They you can try to use the Autos window and see what's going on.

Of course, all this depends on exactly what kind of error it is, which we're not really clear on just yet.

Eilon