h1

Hello,

I've noticed that when I navigate an object in the Local's window (VS debugger), my private variables are displayed with a lock.

But when I navigate a type from the .net class library, the private variables are displayed under the Non-Public members.

Is there an attribute I need to set so that my members are treated the same way as well

Thanks.



Re: Visual Studio Debugger Locals - Non-Public members

Peter Ritchie

I see the lock when I navigate framework class objects in the Locals window (i.e. a FileStream object).

What class do you notice this with






Re: Visual Studio Debugger Locals - Non-Public members

h1

Hi Peter,

I notice it with any clr level class object. Let's take Console...if you put it in the Watch window you'd see:

Console:

+base

<...a list of public member...>

+Non-Public members

where base & Non-Public members have childeren.

When I define a class (for example: Class Program { private _int i; public Program() {}})

and I put an instance of Program in the Watch, what I see is:

program:

(lock icon) _i

What can I do to see it as:

program:

+Non-Public members

And then when I expand Non-Public members I'd see (lock icon) _i. I just thought this behavior maybe caused by an attribute I don't know about.

Thanks





Re: Visual Studio Debugger Locals - Non-Public members

Hua Chen - MSFT

It seems there is no special attribute. private members of System.Console class are static or constant member.

If the private member is an instance member there is a lock icon in the local windows as a System.IO.FileStream instance.

Thanks.






Re: Visual Studio Debugger Locals - Non-Public members

h1

Sorry,

Here is what I want to see:

program:

-Non-Public members

-(lock icon) _i

Instead of:

program

-(lock icon) _i

Thanks





Re: Visual Studio Debugger Locals - Non-Public members

Hua Chen - MSFT

Hello h1:

This issue is not about any attribute. It is about debug setting.

There is a debug option called "Enable Just My Code".

If you turn it off the assemblies provided by others show the same appearance.

Thanks.






Re: Visual Studio Debugger Locals - Non-Public members

h1

Thanks! I didn't relaize that.