Program execution ends suddenly, with no warnings or exceptions, ONLY when debugging!

ε祈祈猫儿з 提交于 2019-12-25 08:39:37

问题


I'm having a very strange issue. My program runs absolutely perfectly if I run it without debugging (by pressing CTRL-F5), but if I try to run it with the debugger, it will crash back to the environment with absolutely no warning, error message, or exception. In fact, according to the output window, the program exited with error code 0, ie, normally!

I've tried running the program on two computers, on one it works absolutely fine and lets me debug it, but on the other it doesn't. That just makes it even odder! I'm using visual c# express 2010.

Any help would be greatly appreciated!

Thanks a lot!


回答1:


  1. Make sure have Exception enabled in VS.
  2. Make sure to be subscribed to AppDomain.UnhandledException

And you will got to your crash reason.

EDIT

How to enable exceptions in VS and VS Express

Hope this helps.



来源:https://stackoverflow.com/questions/6830705/program-execution-ends-suddenly-with-no-warnings-or-exceptions-only-when-debug

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