Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8014911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:05:25+00:00 2026-06-04T20:05:25+00:00

I’m getting JSON from a server in string format and I am saving it

  • 0

I’m getting JSON from a server in string format and I am saving it to a text file

Then I’m reading that text file and giving it back to the server but there I’m not able to parse it back to an object. It may be because the escape sequence are causing the problem or I don’t know.

Please suggest, I’m using C# and Newtonsoft’s JSON.NET

Here are the samples:

String received from server and saving this to local txt file

{"data":"[{\"MenuId\":483,\"Name\":\"Nikhil menu\",\"Desc\":\"test\",\"ASAP\":\"T\",\"LT\":\"T\",\"FO\":\"T\",\"catList\":[{\"CatId\":5132,\"CatName\":\"Cate00\",\"Desc\":\"test\",\"P1\":{\"Id\":1,\"Name\":\"SML\"},\"P2\":{\"Id\":2,\"Name\":\"MED\"},\"P3\":null,\"P4\":null,\"P5\":null,\"P6\":null,\"CatType\":\"Normal\",\"ItemList\":[{\"Id\":38190,\"Name\":\"XXX\",\"Desc\":\"tesdt\",\"MinQ\":1,\"MaxQ\":99,\"MinP\":0.0,\"MaxP\":0.0,\"P1\":100.0,\"P2\":200.0,\"P3\":-99.0,\"P4\":-99.0,\"P5\":-99.0,\"P6\":-99.0,\"Img\":\"\",\"Icon1\":null,\"Icon2\":null,\"Icon3\":null,\"Icon4\":null,\"OpenOn\":{\"Mon\":\"T\",\"Tue\":\"T\",\"Wed\":\"T\",\"Thu\":\"T\",\"Fri\":\"T\",\"Sat\":\"T\",\"Sun\":\"T\"},\"SpecialOffer\":null,\"AddOnList\":[],\"ItemModList\":[]}]}]}]","message":"Processed Successfully","serviceName":"CreateCache","serviceStatus":"S"}

string after reading the same local text file from the server

{"data":"[{\"MenuId\":483,\"Name\":\"Nikhil menu\",\"Desc\":\"test\",\"ASAP\":\"T\",\"LT\":\"T\",\"FO\":\"T\",\"catList\":[{\"CatId\":5132,\"CatName\":\"Cate00\",\"Desc\":\"test\",\"P1\":{\"Id\":1,\"Name\":\"SML\"},\"P2\":{\"Id\":2,\"Name\":\"MED\"},\"P3\":null,\"P4\":null,\"P5\":null,\"P6\":null,\"CatType\":\"Normal\",\"ItemList\":[{\"Id\":38190,\"Name\":\"XXX\",\"Desc\":\"tesdt\",\"MinQ\":1,\"MaxQ\":99,\"MinP\":0.0,\"MaxP\":0.0,\"P1\":100.0,\"P2\":200.0,\"P3\":-99.0,\"P4\":-99.0,\"P5\":-99.0,\"P6\":-99.0,\"Img\":\"\",\"Icon1\":null,\"Icon2\":null,\"Icon3\":null,\"Icon4\":null,\"OpenOn\":{\"Mon\":\"T\",\"Tue\":\"T\",\"Wed\":\"T\",\"Thu\":\"T\",\"Fri\":\"T\",\"Sat\":\"T\",\"Sun\":\"T\"},\"SpecialOffer\":null,\"AddOnList\":[],\"ItemModList\":[]}]}]}]","message":"Processed Successfully","serviceName":"CreateCache","serviceStatus":"S"}

string which I get after adding it to and object of another class which I use to send it over again to server and I get this string on server

{"data":"[{\"MenuId\":483,\"Name\":\"Nikhil menu\",\"Desc\":\"test\",\"ASAP\":\"T\",\"LT\":\"T\",\"FO\":\"T\",\"catList\":[{\"CatId\":5132,\"CatName\":\"Cate00\",\"Desc\":\"test\",\"P1\":{\"Id\":1,\"Name\":\"SML\"},\"P2\":{\"Id\":2,\"Name\":\"MED\"},\"P3\":null,\"P4\":null,\"P5\":null,\"P6\":null,\"CatType\":\"Normal\",\"ItemList\":[{\"Id\":38190,\"Name\":\"XXX\",\"Desc\":\"tesdt\",\"MinQ\":1,\"MaxQ\":99,\"MinP\":0.0,\"MaxP\":0.0,\"P1\":100.0,\"P2\":200.0,\"P3\":-99.0,\"P4\":-99.0,\"P5\":-99.0,\"P6\":-99.0,\"Img\":\"\",\"Icon1\":null,\"Icon2\":null,\"Icon3\":null,\"Icon4\":null,\"OpenOn\":{\"Mon\":\"T\",\"Tue\":\"T\",\"Wed\":\"T\",\"Thu\":\"T\",\"Fri\":\"T\",\"Sat\":\"T\",\"Sun\":\"T\"},\"SpecialOffer\":null,\"AddOnList\":[],\"ItemModList\":[]}]}]}]","message":"Processed Successfully","serviceName":"CreateCache","serviceStatus":"S"}

I am not able to parse this string file back to List

I have tried

JObject jObject = JObject.Parse(obj.cacheInfo.cData);
JToken jT = jObject["data"];
List<Menu> lMenu = JsonConvert.DeserializeObject<List<Menu>>(jT.ToString());

JObject jObject = JObject.Parse(obj.cacheInfo.cData);
JObject jObject = JObject.Parse(jObject["data"].ToString());

any help will do, thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T20:05:27+00:00Added an answer on June 4, 2026 at 8:05 pm

    The problem was with the version of the JSON.NET library on the servers. On one server it was 3.5 and other one it was 4.5. Thanx all for all of your support.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string
I am currently running into a problem where an element is coming back from
I have a reasonable size flat file database of text documents mostly saved in
I have a bunch of posts stored in text files formatted in yaml/textile (from
I'm working with an upstream system that sometimes sends me text destined for HTML/XML

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.