0

VS 2010. The same WPF project, debug mode, two computers:

  • A -- when exception occurrs the caret is placed at the point of exception
  • B -- when the exception occurrs, correct exception is shown but caret is always placed at "win.ShowDialog()" in App.xaml.cs -- this is main entry for showing & running my application, in such case it is very tiresome to track down where the exception occurred

What kind of settings control such behaviour? Of course I would like to switch B, so when exception hits I would be placed at the point of exception, not at the main entry.

greenoldman
  • 16,895
  • 26
  • 119
  • 185
  • 2
    See the accepted answer to this question - http://stackoverflow.com/questions/116896/visual-studio-how-to-break-on-handled-exceptions – ChrisF Dec 27 '10 at 11:50

2 Answers2

3

You mean you'd want to break the IDE on the line where the exception has been thrown ?

It is in the Debug menu, under exceptions. There you can check a checkbox that 'll make sure the IDE breaks in the code and shows the line where the exception has been thrown.

Frederik Gheysels
  • 56,135
  • 11
  • 101
  • 154
0

I think the OP is asking about SEH, and catching "First class exceptions", which naturally requires SEH exception handling, not sure if this is still true in C#.

Arafangion
  • 11,517
  • 1
  • 40
  • 72