Forum Visual Studio
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Why "ToString" not used in Locals pane, but shown in Watch and data tooltips?

In Visual Studio 2017 Enterprise, with Resharper.
Debugging a Xamarin.Forms app, running on an Android phone.

Variables in Locals pane are not showing "ToString" value for my objects,
just showing the default display, which is the name of the class of each object.

The same variable added as a Watch does show the result of calling ToString() on the object.
Hovering over the variable in the code pane also shows ToString() value.

Interestingly, one can force evaluation by adding

[System.Diagnostics.DebuggerDisplay( "{ToString()}" )]

before the class definition.

So the Locals pane (but only the Locals pane) is acting as if
Tools / Options / Debugging / "Enable property evaluation and other implicit function calls"
were unchecked.

Is this expected?

(I've confirmed that my Visual Studio / Locals does show ToString values when I debug a VB .NET desktop application,
so it is only Xamarin that is not showing this.)



  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    I don't think that's a Xamarin thing. That's a Visual Studio behavior. Best to report it through the feedback feature of Visual Studio along with screenshots.

  • SteveShaw.5557SteveShaw.5557 USMember ✭✭✭
    edited November 2018

    @ClintStLaurent - As I said, it is only Xamarin's plug-in that is exhibiting this behavior. Therefore, it is a Xamarin thing. Yes, I should file a bug report against Xamarin's plug-in, but before doing so, I figured I'd find out if anyone here is/is not seeing this behavior, or knows whether it is by design.

    If its not what others are seeing, or only happens under certain circumstances (that happen to be my circumstances), then I can file a much more useful bug report, by trying to narrow down what the circumstances are.

    Right now, I have to assume it always happens, until demonstrated otherwise...

Sign In or Register to comment.