How do I set the debugger to Break on Exception

Platform: WinForms| Category: Debugging
1) In VS.NET go to the Debug Menu >> 'Exceptions...' >> 'Common Language Runtime Exceptions' >> 'System'  and select 'System.NullReferenceException' 
 
2)  In the bottom of that dialog there is a 'When the exception is thrown:' group box, select 'Break into the debugger' 

3) Run your scenario.   When the exception is thrown, the debugger will stop and notify you with a dialog that says something like: 
  		'An exception of type 'System.NullReferenceException' has been thrown.
		[Break] [Continue]'

Hit [Break].   This will put you on the line of code that’s causing the problem.

(from sburke_online@microsoft..nospam..com on microsoft.public.dotnet.framework.windowsforms)

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.