0
private void Form1_Load(object sender, EventArgs e)
{
    Directory.CreateDirectory(null);
    MessageBox.Show("hnjkh");
}

When I run above sample code, VS2013 says A first chance exception of type 'System.ArgumentNullException' occurred in mscorlib.dll. Then remaining code not work.

Is this behaviour normal?

If this behaviour is normal, when a first chance exception occured, sometimes I can not find location of the problem. Debugging in this way is very hard for large projects.

How can i find exact line of the problematic code?

I don't want to toggle exceptions for every type of exception. Also when I toggle exceptions then it is thrown even user handled. I want to show only user unhandled exceptions.

volkans80
  • 13
  • 6
  • possible duplicate of [VS2010 does not show unhandled exception message in a WinForms Application on a 64-bit version of Windows](http://stackoverflow.com/questions/4933958/vs2010-does-not-show-unhandled-exception-message-in-a-winforms-application-on-a) – Hans Passant May 24 '14 at 13:03
  • Yes i think the problem is related Form_Load event. When i move codes to button1_click then it is working normally. – volkans80 May 26 '14 at 06:10

2 Answers2

0

Turn on the Exceptions thrown for Common Language Runtime Exceptions

Debug->Exceptions Select the thrown check box next to "Common Language Runtime Exceptions"

  • I don't want to toggle exceptions for every type of exception. Also when I toggle exceptions then it is thrown even user handled. I want to show only user unhandled exceptions. – volkans80 May 24 '14 at 07:30
0

The problem discussed here. When i move codes to button1_click then it works normally. Thanks to Hans Passant.

Community
  • 1
  • 1
volkans80
  • 13
  • 6