You are developing an ASP.NET MVC application by using Visual Studio 2012.
The application throws and handles exceptions when it runs.
You need to examine the state of the application when exceptions are thrown.
What should you do?
A . From the Debug menu in Visual Studio 2012, select Exceptions. Enable the Thrown check box for Common Language Runtime Exceptions.
B . From the Debug menu in Visual Studio 2012, select Exceptions. Disable the User-unhandled check box for Common Language Runtime Exceptions.
C . Add the following code to the web.config file of the application.<customErrors mode="On" ><error statusCode="500" redirect="CustomErrors.html" /></customErrors>
D . Add the following code to the web.config file of the application.<customErrors mode="On" ><error statusCode="404" redirect="CustomErrors.html" /></customErrors>
Answer: A
Explanation:
Configuring the debugger to break for first chance exceptions
To change when the debugger breaks, go to Debug->Exceptions…
When you first open this window you will see that there is a tree grid with one column and checkboxes.
* Break when Thrown. This includes a default list of exceptions known by the debugger, grouped by category.
Note: The possible exceptions that could break from this list is determined by the runtime you are debugging. For example, if you are using managed-only debugging then the debugger will never break for C++, Win32 Exceptions, etc. even if they are configured to break when thrown.
* Checkboxes. If you check the box for a category, then the debugger will break for all First Chance Exceptions while debugging. If you don’t want to enable all First Chance Exceptions, you can find the specific exception types that you wish to configure by using the search box.
Leave a Reply