Hide a member from the debugger window using the DebuggerBrowsable attribute

By [)ia6l0 iii

You can use the DebuggerBrowsable attribute and control the appearance of the members in the debugger window.

You can use the DebuggerBrowsableState with the value of Never to hide a member, from appearing in the debugger window.

The following property will never be visible in a debugger or the watch window.

[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string _confidentialName
    {
         get;
        set;
     }

Related FAQs

You can use the Visual Studio's watch window to edit the values of the variables at run time.
You can drag and drop statements in watch window, and the windows will evaluate the statement.
Hide a member from the debugger window using the DebuggerBrowsable attribute  (1014 Views)