Determining which code line threw the exception
问题 In dotNet a line throws an exception and is caught, how can I figure out which line in which file threw the exception? Seems relatively straightforward, but I can't figure it out... 回答1: You can only do it if you have debug symbols available. catch(Exception ex) { // check the ex.StackTrace property } If you want to debug such a situation in VS, you'd better just check Thrown checkbox for Common Language Runtime Exceptions in Exceptions dialog located in Debug menu. The debugger will break as