开发者

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

开发者 https://www.devze.com 2023-01-31 00:05 出处:网络
I have a VS 2010 C# .NET 4 project. The iss开发者_运维百科ue is that the program is not breaking on \'NullReferenceException\' errors during debugging.

I have a VS 2010 C# .NET 4 project. The iss开发者_运维百科ue 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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消