 <p>That’s a runtime exception so the compiler can’t help you with catching it at a compile time. And the <code>try-catch</code> block helps you to <strong>handle</strong> this exception, not to prevent it from being thrown at the runtime. If you don’t make a try-catch block it will be handled at a general application level.</p> <p>A quote from MSDN:</p> <blockquote> <p>When an exception is thrown, the common language runtime (CLR) looks for the catch statement that handles this exception. If the currently executing method does not contain such a catch block, the CLR looks at the method that called the current method, and so on up the call stack. If no catch block is found, then the CLR displays an unhandled exception message to the user and stops execution of the program.</p> </blockquote> <p>Please refer to the <a href="https://msdn.microsoft.com/en-us/library/0yd65esw.aspx" rel="nofollow">MSDN try-catch</a> for more information.</p>