question

BjrnGlueHansen-8924 avatar image
0 Votes"
BjrnGlueHansen-8924 asked BjrnGlueHansen-8924 commented

Datatip of string truncated in VS 2022

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.

vs-generalvs-debugging
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

cooldadtx avatar image
1 Vote"
cooldadtx answered BjrnGlueHansen-8924 commented

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you for the fast response.

The datatip doesn't have a magnifying glass and the value is also truncated to 1000 characters in the locals and autos window.
The Immediate window is the only thing that has worked, which is a bit annoying, but better than having to write to the browser console.

0 Votes 0 ·