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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:10:50+00:00 2026-06-15T08:10:50+00:00

I use stock JSON serialiser in .NET 4.5 windows store app – System.Runtime.Serialization.Json.DataContractJsonSerializer I

  • 0

I use stock JSON serialiser in .NET 4.5 windows store app –

System.Runtime.Serialization.Json.DataContractJsonSerializer

I have a class which is supplied by the API provider say

class A { public DateTime Date {get;set} }

I wanted to hide Date field by doing this (NOTE – new keyword):

class AEx : A { public new string Date {get;set} }  

But I am getting exception:

type ‘AEx’ is not serializable with DataContractJsonSerializer because the data member ‘Date’ is duplicated in its type hierarchy.

I understand what it does.. My question however is not HOW does it do but why?

Logically speaking it should be compatible with the programming features like polymorphism. Why this class was made to ignore it?

  • 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-15T08:10:53+00:00Added an answer on June 15, 2026 at 8:10 am

    Your class basically contains two properties with the same name. So if you try to deserialize some JSON which contains that property name, there’s no way of knowing which property to set.

    Likewise when serializing an object of that type, you’ve got two values which need to be serialized using the same property name – what would you expect the JSON to look like?

    Fundamentally, a type with two properties of the same name is incompatible with serialization of a plain name/value pair format. (A more advanced serialization mechanism which could specify which property was associated with which declaring class would cope, but JSON doesn’t do that.)

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

Sidebar

Related Questions

I have a groupby and sum table that I use to display current stock
I have a JSON string and I'd like to use to compose an object.
hi i have found a tutorial on how to use post json in lua.
I'm developing an application that shows stock market information. In my application I use
I have the need to use a Stack-like data structure for a program that
I am attempting to use the Yahoo! Finance API to gather current stock quotes
Jersey 1.6 can produce: @Path(/stock) public class StockResource { @GET @Produces(MediaType.APPLICATION_JSON) public List<Stock> get()
I have some json-code with has multiple objects in it, as such: These are
I am trying to use the JSON-lib api in my code to convert a
I have a recursive data structure. Something like... Public Class Comparison Property Id As

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.