Datatip of string truncated in VS 2022

Bjørn Glue Hansen 26 Reputation points
2022-01-27T14:23:44.617+00:00

Hello

I have started using Visual Studio 2022 for a .net 6.0 C# project and I am having issues with long strings getting truncated in datatips when debugging. It seems like the string is truncated to 1000 characters which was not the case in Visual Studio 2019.

Is there a setting where the limit can be changed? I have ReSharper and Productivity Power Tools installed, but ReSharper is set to not replace datatips.

Edit 1: After talking with a college, this might be because I am breaking inside of the Client side of a Blazor Wasm solution, so the debugger sees the variable as a dynamic type instead of a string.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,557 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
932 questions
0 comments No comments
{count} vote

Accepted answer
  1. Michael Taylor 47,461 Reputation points
    2022-01-27T15:34:49.807+00:00

    Datatips are just quick visual indicators. If the value is really long or complex then either look at it in the Locals/Autos/This window where you can see the full value or click on the magnifying glass next to the value (if any) to use the debugger visualizer. In both cases you should be able to see the whole value. Alternatively you can go to the Immediate window, type in the value name and press ENTER and it'll auto call the ToString method on it.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful