Microsoft
70-519 · Question #71
An ASP.NET Web application contains a class named Money. The Money class has properties named Value and Currency. The Locals window of the Microsoft Visual Studio 2010 IDE currently displays the…
The correct answer is A. Apply the DebuggerDisplay attribute to the class. See the full explanation below for the reasoning.
Question
An ASP.NET Web application contains a class named Money. The Money class has properties named Value and Currency. The Locals window of the Microsoft Visual Studio 2010 IDE currently displays the Value and Currency properties only when the Money object is expanded. You have the following requirements:
- Display the Value and Currency property values in the Locals window.
- Display the property values without requiring the developer to expand
the Money object. You need to recommend an approach for modifying the Money class to meet the requirements. What should you do?
Options
- AApply the DebuggerDisplay attribute to the class.
- BIn the constructor, create a new instance of the LocalsItemDescription class for each of the
- CIn the Value and Currency property setters, call the Debug.WriteLine() method.
- DModify the class to inherit from the LocalVariableInfo class.
How the community answered
(39 responses)- A77% (30)
- B8% (3)
- C13% (5)
- D3% (1)
Community Discussion
No community discussion yet for this question.