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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:05:30+00:00 2026-05-29T10:05:30+00:00

Possible Duplicate: Deserializing JSON into an object with Json.NET Any ideas of how to

  • 0

Possible Duplicate:
Deserializing JSON into an object with Json.NET

Any ideas of how to deserialize the following response into anonymous type using Json.Net?

{"d":[{"day":"Wednesday","firstSet":{"start":"17:00","close":"23:00","hours":6,"isValid":true},"secondSet":{"start":"00:00","close":"00:00","hours":0,"isValid":false},"personMinimum":2,"personMaximum":25}]}

Attempts so far result in the following error

Could not cast or convert from System.String to <>f__AnonymousType35[System.String,<>f__AnonymousType24[System.String,System.String,System.Int32,System.Boolean],<>f__AnonymousType2`4[System.String,System.String,System.Int32,System.Boolean],System.Int32,System.Int32].

Code is supplied below

var json_complex = new
{
  d = new
  {
    day = "",
    firstSet = new
    {
      start = "",
      close = "",
      hours = 0,
      isValid = false
    },
    secondSet = new
    {
      start = "",
      close = "",
      hours = 0,
      isValid = false
    },
    personMinimum = 2,
    personMaximum = 25
  }
};
var json = JsonConvert.DeserializeAnonymousType(jsonResponse, json_complex);

Any ideas?

  • 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-05-29T10:05:30+00:00Added an answer on May 29, 2026 at 10:05 am

    First of all I must say why are you including third party into your application ?

    Asp.net provides JavaScriptSerializer for serialization !

    Look at my question and refer the answer you can get idea from this

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

Sidebar

Related Questions

Possible Duplicate: Deserializing XML, how do I access attributes? I am deserializing the following
Possible Duplicate: .NET - What’s the best way to implement a catch all exceptions
Possible Duplicate: How do you send email from a Java app using Gmail? How
Possible Duplicate: Singleton: How should it be used Following on from Ewan Makepeace 's
Possible Duplicate: How can I combine multiple rows into a comma-delimited list in Oracle?
Possible Duplicate: In Vim: How do I delete a word and go into insert
Possible Duplicate: Are there any O(1/n) algorithms? Any algorithm whose complexity decreases with increase
Possible Duplicate: Split A4 PDF page into two A5 and back again I have
Possible Duplicate: .NET Enumeration allows comma in the last field public enum SubPackageBackupModes {
Possible Duplicate: Create Generic method constraining T to an Enum Is there any reason

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.