Developing ASP.NET MVC Web Applications — Question 87
You are developing an ASP.NET MVC application by using Visual Studio.
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?
Answer options
- A. From the Debug menu in Visual Studio, select Exceptions. Enable the Thrown check box for Common Language Runtime Exceptions.
- B. From the DEBUG menu in Visual Studio, select Attach to Process. Select the IIS process.
- C. From the Debug menu in Visual Studio, select Exceptions. Disable the User-unhandled check box for Common Language Runtime Exceptions.
- D. From the TOOLS menu in Visual Studio, click Customize. Click the Command tab and select Debug.
Correct answer: A
Explanation
Enabling the Thrown check box for Common Language Runtime Exceptions allows the debugger to break execution at the point where an exception is thrown, providing insight into the application's state. The other options either do not provide the same level of insight into exceptions or are related to different debugging tasks that do not directly address examining exceptions as they occur.