Reputation: 1005
When inspecting the Response of a Webservice in the debugger window, every field of the response is listed twice - once with an appendix of Field.
(source: mlkshk.com)
How can I hide the second listing?
The webservice reference is added as outlined on the msdn library, so I don't want to add the attribute [DebuggerBrowsable(DebuggerBrowsableState.Never)] manually.
Upvotes: 1
Views: 168
Reputation: 3262
This is a bit of a hack, and isn't as presentable as the regular Watch window would be, but you could use this process.
That way you can filter out the stuff you don't want to see. Here's a screenshot of it in action:
Utility method:
public static List<Tuple<String,Object>> GetFieldValues(Object instance)
{
var fields = instance.GetType().GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly);
var fieldValues = new List<Tuple<String, Object>>();
foreach (var f in fields) { fieldValues.Add(new Tuple<string, Object>(f.Name, f.GetValue(instance))); }
return fieldValues;
}
And the Immediate Window code:
var blah = J.GetFieldValues(this);
Upvotes: 1