Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

StringBuilder.Append not working

Tags:

json

string

c#

We have a WCF project where JSON responses are generated automatically but in one scenario we are creating the JSON manually and sending it to browser. That part works fine.

Last night I noticed a bug and tried to figure it out but the problem is really strange. Somehow after concatenating the string values, a block gets removed and I don't have an idea what happened here. See the following code, what is happening?

My code that is causing the problem

Following is the snapshot of JSON after the "innerBlock" return data

Result returned after innerBlock

Following is the snapshot of JSON after string append!

Result returned after concatenation

like image 658
Behroz Sikander Avatar asked Nov 13 '22 12:11

Behroz Sikander


1 Answers

The .Net application was working fine. Since, my JSON was too big, I was using some JSON viewers, but unfortunately they had bugs. Tested the JSON in notepad and things were working fine.

  1. http://jsonviewer.stack.hu

  2. http://jsonlint.com

like image 67
Behroz Sikander Avatar answered Nov 15 '22 04:11

Behroz Sikander