Visual Studio Developer Center >
Visual Studio Forums
>
Visual Studio Debugger
>
Can not see public members in watch window and DataTipp
Can not see public members in watch window and DataTipp
- Hi all,
first of all have to apologize for my bad english, I hope for your understanding.
My watch window shows only a selection of all accessable members.
For example, when I add a variable named "met" of type MethodInfo, only a subset of its public members is visible.
For example members like: IsAbstract, IsConstructor, IsXYZ etc. ... are there, but not the Name property.
I just want to watch the Name property for instance, and it's possible to do this by expanding the "base" node and navigate to the name property there, or simply type "met.Name" and add a watch only for this specific prop.
Can anybody tell me if there is a way to show all members, declared ones, AND inherited ones, inside the watch window ?
My problem is, I just can't remember if this is the default behaviour (no joke, had a break for several weeks : ),
or if I had set any Debugging-Option to have the watch window behave like this.
I also couldn't find any attribute like DebuggerBrowsable, applied to MethodInfo or one of its base classes (i.e. MethodBase, MemberInfo).
The "Name" prop. is a member of MemberInfo and it is defined abstract, and maybe this could be the reason why this prop. is not visible by default ?
I also tried to add the "hidden" format specifier, but the "Name" isn't displayed in the root node of "met"
(i.e. I typed "met, hidden").
The DataTip shows exactly the same info when hoovering over the met variable inside the editor.
Any help is appreciated.
TIA
Michael
Answers
- C# supports "Multiple Implementation", which is to says a class can implement more than one interface, these interfaces may define the methods/properties with the same name. so display them in the root node may conduct confusion.
- Marked As Answer byRoahn LuoMSFT, ModeratorMonday, November 02, 2009 3:58 AM
All Replies
- C# supports "Multiple Implementation", which is to says a class can implement more than one interface, these interfaces may define the methods/properties with the same name. so display them in the root node may conduct confusion.
- Marked As Answer byRoahn LuoMSFT, ModeratorMonday, November 02, 2009 3:58 AM
- Hello Michael,
Instead of using Watch windows, could you please tell us if we could see the property in the Autos/Locals windows after clicking the "base" node?
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
If you have any feedback, please tell us.
Welcome to the All-In-One Code Framework! - Hello Michael,
I'm marking Lei's reply as answer if you don't mind. Would you please tell me if my suggetion work? how about the issue now? If you have feedback, pelase tell us.
Best regards,
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
If you have any feedback, please tell us.
Welcome to the All-In-One Code Framework! - Hi Lei Shi,
thanks for your quick reply, your are certainly right, it would be misleading.
Initially I wasn't sure if this is default behavior, or just the result of any debugging option or IDE setting. - Hello Roahn Luo,
also many thanks for your reply.
Yes, you're right, name is displayed in MethoBase's base node, in Autos, Locals, and Watch window.
If the watch is added for a variable of Type MethodInfo, it is the second "base" node.
(for the variable MethodInfo met it would be: met.base.base.Name).
The name prop is allways contained in the node of the MemberInfo type.
As far as I can see now, there is no issue with the Watch window.
It seems to be a feature, isn't it ?
Thanks for your time.
Michael


