How to use Stacktrace to return Error Line Number in vb.net

后端 未结 7 1112
名媛妹妹
名媛妹妹 2021-02-05 20:08

I am trying to create some sort of error catching method that will return the error line number. We have an abort email that is sent out when a process aborts that gives us the

7条回答
  •  终归单人心
    2021-02-05 20:45

    You should definitely use the stack trace, since you can use a global exception catching mechanism that you will need to code only once.

    To get the exact line on which the error was thrown, you will need to ship the pdb files with your application. Those pdb files contain debug information, including the error's line number.

    If you want to know how to catch unhandled exceptions gracefully, have a look at this codeproject article.

提交回复
热议问题