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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:05:05+00:00 2026-06-03T13:05:05+00:00

Json.Net has no problem serializing an overridden property in a child class. public override

  • 0

Json.Net has no problem serializing an overridden property in a child class.

public override ICollection<Person> Persons { get; set; }

But if I try to use new on the property, the serialization fails. There’s no exception; Persons are just never serialized.

public new ICollection<Person> Persons { get; set; }

Why is this?

(This example doesn’t make much sense, I know. It’s only an example. The goal later is to be able to change datatype of the property public new ICollection<PersonDto> Persons { get; set; })

  • 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-03T13:05:09+00:00Added an answer on June 3, 2026 at 1:05 pm

    I discovered a simpler way to solved this without having to create a custom JsonConverter

    If you put the attribute JsonProperty over the property it works.

    [JsonProperty]
    public new ICollection<PersonDto> Persons { get; set; }
    

    I don’t know why Json.Net needs the attribute here. Normally it serializes everything that isn’t decorated with JsonIgnore. If someone knows, you’re welcome to drop a comment.

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

Sidebar

Related Questions

I wish to use JSON.Net on a brand spankin new Mono class library (say
I started to use Json.NET to convert a string in JSON format to object
I am using json.net to parse objects and delivering them to a webservice I
I am using Json.NET to serialize an object graph. For each object that is
I'm new with JSON.NET and I'm trying to deserialize a JSON string to a
I use JSON.NET and I would like to parse the following object which I
I am trying to use the NETFx Json.NET MediaTypeFormatter nuget package to swap out
Currently I am using the terrific Linq 2 Json.net (by newtonsoft), which is a
I am attempting to use ASP.NET MVC 4 beta together with JSON.NET. I'm using
When working with JSON, I can use NuGet to add JSON.Net and this allows

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.