Determining which code line threw the exception

前端 未结 4 1385
故里飘歌
故里飘歌 2021-01-05 11:56

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

4条回答
  •  难免孤独
    2021-01-05 12:23

    Personally, I just log the exception's ToString() return value. The whole stack trace is included. It's one line of code ... dead simple.

提交回复
热议问题