c# - Json file corrupted -


i have json file named test.json in root of website. hosted on windows server 2012 r2 in iis version 6.2. json file 2698kb. have written small c# console application simple accesses file , writes byte array file.

class program {     static void main(string[] args)     {         webclient client = new webclient();         byte[] data = client.downloaddata("http://mywebsite/test.json");         file.writeallbytes("d:\\test\\download.json", data);     } } 

when run exe on local machine, , compare downloaded file original file in website root, 2 identical. when run exe on server (the same server hosting site) , compare downloaded file original downloaded file corrupted, , each time in different place or different way. example:

original json:

"deleted" : false, "createdate" : "2012-09-04t07:57:41.5947956", "moduser" : "cfr", 

corrupt json:

"language" : null, "dell," lookup ":null," languageid ":1," 

it corrupt , makes no sense , cannot parsed. functionality working fine on website long time, , files corrupt. if download json through internet explorer corrupt when using browser on server. not local machine. don't know causing problem. or tips appreciated.

i have found workaround. added mywebsite hosts file on webserver localhost ip 127.0.0.1 , when access json data no longer corrupt.


Comments