-2

I'm debugging my code and I notice my 'Locals' window has 'Non-Public members':

enter image description here

I understand what non-public members are conceptually but what '_a' (or underscore any other member, for that matter) has a value of 1177541353 of type int escapes me.

More importantly how, specifically, does it help me debug my code? Under what circumstances is this useful?

JuanR
  • 7,405
  • 1
  • 19
  • 30
user2284341
  • 661
  • 4
  • 17
  • 38
  • 1
    google for "Guid.cs" – Selvin Mar 20 '19 at 14:06
  • For questions like this you can look into [sources](https://referencesource.microsoft.com/#mscorlib/system/guid.cs,30). – Sinatr Mar 20 '19 at 14:08
  • 1
    It's a member (i.e. a property, etc.) thats not public (i.e. `private`, `protected`, etc) – Liam Mar 20 '19 at 14:11
  • 3
    Possible duplicate of [What goes in the "Non-Public members" node in Visual Studio's Watch window?](https://stackoverflow.com/questions/11594725/what-goes-in-the-non-public-members-node-in-visual-studios-watch-window) – Sinatr Mar 20 '19 at 14:11
  • 1
    Possible duplicate of [In C#, what is the difference between public, private, protected, and having no access modifier?](https://stackoverflow.com/questions/614818/in-c-what-is-the-difference-between-public-private-protected-and-having-no) – Liam Mar 20 '19 at 14:12
  • 3
    *Usually* you'll ignore it. But sometimes, you'll be tracking a bug and you see something "odd" and want to dig into the internals of the type despite the fact that the internals are "off-limits" so far as normal (programming) usage of the type. That's what that node's for. – Damien_The_Unbeliever Mar 20 '19 at 14:13
  • There is a reason they are not public. They are not meant for you (the consumer) to understand. They are part of the inner workings of the object. They are useful for debugging when you own the source code but should otherwise be ignored if you are simply consuming the object. – JuanR Mar 20 '19 at 14:29

1 Answers1

0

These are private fields from the struct "Guid". Here's the source code for the Guid struct, in which you can find the private fields displayed in your debugger.

Laurent
  • 478
  • 7
  • 15