Skip to main content

Posts

Showing posts with the label DebuggerBrowsableAttribute

Customizing debugging session - Part II

Continuing to my previous article on 'Customizing debugging session' , we can further control on how properties and fields appear in our debugger window. Based on our debugging requirement, we can show and hide properties in our debugging session using one of the useful attribute named DebuggerBrowsableAttribute . Let’s go ahead and see debug window for one of the code snippet: In above image you will notice that by default list of Awards is not in expanded form. In order to view the values of awards, one needs to expand that forcibly either by hovering the mouse or by click on the plus symbol, which will result in below screenshot: How to hide unwanted properties during debugging session? What if a developer is not interested in viewing employee’s branch? Well, that unwanted property can be made hidden by using DebuggerBrowsableState as Never as shown below: Now let’s run the code and check, whether it is h