How do I allow breaking on 'System.NullReferenceException' in VS2010?

拟墨画扇 提交于 2019-11-27 23:20:35

问题


I have a VS 2010 C# .NET 4 project. The issue is that the program is not breaking on 'NullReferenceException' errors during debugging.

The output window will display the following:

A first chance exception of type 'System.NullReferenceException' occurred in myProgram.exe

...but the debugger will just exit out of the function and continue running the rest of the program.

How do I change this behavior so that the debugger will break on these exceptions?


回答1:


Go to Debug -> Exceptions -> Search for NullReferenceException and check the "thrown" checkbox.



来源:https://stackoverflow.com/questions/4475464/how-do-i-allow-breaking-on-system-nullreferenceexception-in-vs2010

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