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

  • Home
  • SEARCH
  • 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 8963213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:18:36+00:00 2026-06-15T16:18:36+00:00

How do I deserialize this text. I tried with JSON but I get Invalid

  • 0

How do I deserialize this text. I tried with JSON but I get “Invalid JSON primitive” error.

{
"meta": {
  "limit": 20,
  "next": null,
  "offset": 0,
  "previous": null,
  "total_count": 1
},
"objects": [
  {
     "blocked": false,
     "groups": [],
     "id": "1111",
     "name": "John Doe",
     "number": "+15555555555",
     "resource_uri": "/api/v1/contacts/1111/"
  }
 ]
}

This is the code I used:

var jss = new JavaScriptSerializer();
var dictionary = jss.Deserialize<Dictionary<string, string>>(buffer.ToString());
  • 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-15T16:18:38+00:00Added an answer on June 15, 2026 at 4:18 pm

    Easy to Fix. Deserialize to <Dictionary<string, object> instead of <Dictionary<string, string>

    var dictionary = jss.Deserialize<Dictionary<string, object>>(buffer.ToString());
    

    Full test code

    string json = @"{
        ""meta"": {
            ""limit"": 20,
            ""next"": null,
            ""offset"": 0,
            ""previous"": null,
            ""total_count"": 1
        },
        ""objects"": [
            {
                ""blocked"": false,
                ""groups"": [],
                ""id"": ""1111"",
                ""name"": ""John Doe"",
                ""number"": ""+15555555555"",
                ""resource_uri"": ""/api/v1/contacts/1111/""
            }
            ]
        }";
    
    var jss = new JavaScriptSerializer();
    var dictionary = jss.Deserialize<Dictionary<string, object>>(json);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use eval() function to deserialize this JSON text by using
How do I setup Newtonsoft Json.net to deserialize this text into a .NET object?
I have all this JSON text that I want to deserialize (or something) into
I am trying to deserialize this JSON array into my android project. [{Name:Ban,Price:1},{Name:Banana,Price:1},{Name:chicken,Price:14},{Name:pizza,Price:16},{Name:slice,Price:1}] I
I'm having some issues to deserialize a Json array that follows this format: [
i have a question to deserialize JSON text to an javascript object, i test
OK, first of all of this is done in Java: I deserialize a text
I am trying to deserialize a JSON String like (extracted this bit to show
This is my first try to deserialize a JSON string returned by Facebook. I
I'm trying to deserialize JSON text using the Lift framework, and it doesn't appear

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.