Reputation: 51
I have a long json string variable in my C# project. When I try to inspect this variable in VARIABLES or WATCH - I am only shown the beginning of the string. Rest of the text is hidden.
Even when I try to copy value only the beginning of the text is copied.
What can I do to show the entire value (or at least to copy the entire value)?
Upvotes: 3
Views: 1156
Reputation: 3
I know this is an old issue but I encountered this problem now.
What I do is to goto the "Debug Console" window and then substring on my variable.
Detail instructions:
In Visual Studio Code, when you are debugging, place a breakpoint on the breaking item. In my case it is an Exception where I want to know what the message is.
Next I open the "Terminal" window (Menu -> View -> Terminal).
If you type ex.Message
and enter, then you get only the first 100 characters.
Visual Studio Code is not showing anything more (just three dots).
Then I input in my Terminal ex.Message.Substring(100)
. I get the next 100 characters of my message.
If still I do not have the complete message then I type ex.Message.Substring(200)
. I get the next 100 characters.
and so on until I see my complete message.
This is the way how I was able to get my complete message. I did the same for the StackTrace. I didn't find anything else to resolve this or a way to make sure Visual Studio is showing the complete message.
Upvotes: 0
Reputation: 145
My bad...misread the question. Did you try below options:
Option 2: in Debug console you can type your variable and view the values and copy them as well
Upvotes: 1
Reputation: 145
In the quickwatch or Watch window, there is an watch icon clicking on which will show the entire value of the variable. You can also choose what type of visualizer to view in.
Upvotes: 1