Why do my exception stack traces always point to the last method line?

笑着哭i 提交于 2019-12-22 11:27:46

问题


I have a problem with my Visual Studio installation. When I got an exception I always have incorrect line numbers in it's stack trace. There are always point to last line of each method in my codebase. At the same time it's OK when I'm tracing programs with debugger. What's happed with PDBs?

No, I'm not re-throwing exception at each method.

In each line of stack trace I have last row of corresponding method, while exception had thrown by statement in the middle.


回答1:


Sounds like you're running your app in Release mode. Release mode has difficulties with line numbers for exceptions and whatnot.

Compile your app in Debug mode (no need to attach the debugger) and see if it sorts itself out.



来源:https://stackoverflow.com/questions/28607/why-do-my-exception-stack-traces-always-point-to-the-last-method-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!