Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Text Visualizer missing text

I am debugging a string variable in Visual Studio using the Text Visualizer. However, it seems that a large part in the middle of the string is missing. What is the reason behind this?

enter image description here

like image 368
Chin Avatar asked Dec 02 '15 22:12

Chin


2 Answers

The Text Visualizer in Visual Studio can only display about 32,700 characters. If your string is longer than that, it will automatically replaces the excess part in the middle of the string with ....

I found this out the hard way.

Edit: this seems to have been fixed in Update 2. If you're on Update 1, see Diamond's answer.

like image 86
Chin Avatar answered Sep 18 '22 12:09

Chin


This is an issue that was introduced with Visual Studio 2015 Update 1 as reported here: https://connect.microsoft.com/VisualStudio/feedback/details/2016177/text-visualizer-misses-corrupts-text-in-long-strings.

Microsoft will have a permanent fix for this in the first update after Update 1. In the meantime, use the following workaround: You can set the length at which the Text Visualizer will truncate by adding a registry key. Use the following command to set the length to a larger number (example 250000):

reg add HKCU\Software\Microsoft\VisualStudio\14.0\Debugger /v TextVisualizerStringLimit /t REG_DWORD /d [number]

Alternatively use a previous version of Visual Studio if you have one installed.

like image 21
Ɖiamond ǤeezeƦ Avatar answered Sep 17 '22 12:09

Ɖiamond ǤeezeƦ