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 8775579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:50:17+00:00 2026-06-13T18:50:17+00:00

When I am trying to deserialize my JSON with JSON.Net it gives me invalid

  • 0

When I am trying to deserialize my JSON with JSON.Net it gives me invalid values for JSON arrays.

I have simple JSON:

[
{
    "PhaseName": "Start",
    "Advices": ["Lorem ipsum dolor",
    "Lorem ipsum dolor",
    "Lorem ipsum dolor"]
},
{
    "PhaseName": "In Progress",
    "Advices": ["Lorem ipsum dolor",
    "Lorem ipsum dolor",
    "Lorem ipsum dolor"]
},
{
    "PhaseName": "Finish",
    "Advices": ["Lorem ipsum dolor",
    "Lorem ipsum dolor",
    "Lorem ipsum dolor"]
}

]

And a correspondent class in my code:

public class Advices
{
    public string PhaseName { get; set; }
    public List<string> AdvicesList { get; set; }
}

And a veriable that represents an array of Advices objects:

public class MyAdvices
{
    private Advices[] MyAdvicesArrays;
....

So when I am trying to deserialize my JSON like that:

MyAdvicesArrays= JsonConvert.DeserializeObject<Advices[]>(sMyJSON));

JSON.Net populates “Phase Name” property of each object in my MyAdvicesArrays array with correct value but Advices array of each object is invalid: “Could not evaluate expression” if you check them in runtime. I don’t get it. What I’ve done wrong?

  • 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-13T18:50:19+00:00Added an answer on June 13, 2026 at 6:50 pm

    No, you’re JSON is incorrect as is you Class.

    First change your JSON to this:

    {
        phases:[
            {
                "PhaseName": "Start",
                "Advices": ["Lorem ipsum dolor",
                "Lorem ipsum dolor",
                "Lorem ipsum dolor"]
            },
            {
                "PhaseName": "In Progress",
                "Advices": ["Lorem ipsum dolor",
                "Lorem ipsum dolor",
                "Lorem ipsum dolor"]
            },
            {
                "PhaseName": "Finish",
                "Advices": ["Lorem ipsum dolor",
                "Lorem ipsum dolor",
                "Lorem ipsum dolor"]
            }
        ]
    }
    

    Notice before you weren’t declaring you JSON object correctly. Also you need a property for the array.

    Now you’ll need two classes:

    public class AnythinYouWant{
        public List<Phase> Phases{get;set;}
    }
    
    public class Phase{
        public string PhaseName{get;set;}
        public List<string> Advices{get;set;}
    }
    

    Notice how the first class is for the top level JSON object. The name can be whatever you want. But any property needs to match the name.

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

Sidebar

Related Questions

I'm new with JSON.NET and I'm trying to deserialize a JSON string to a
I am trying to serialize/deserialize JSON in Android using GSON. I have two classes
I'm trying to create two method to serialize/deserialize classes using Json.Net and save/load them
I am trying to deserialize a JSON string that was serialized by JSON.Net 4.0
I'm trying to use JSON.Net to deserialize a JSON object into a C# object.
I am trying to deserialize a JSON string using VB.net and cannot seem to
I am trying to deserialize the following JSON, but I really have no idea
I have a simple JSON object graph I'm trying to render using a Mustache
i'm trying to deserialize a json string pulled from the web using json.net, but
I am trying to deserialize some reddit comments (returned in JSON) using JSON.NET. I

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.