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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:24:57+00:00 2026-05-13T07:24:57+00:00

I’m getting a bit frustrated by the lack of consistency within the different forms

  • 0

I’m getting a bit frustrated by the lack of consistency within the different forms of serialization in .NET:

  • DataContractSerializer – uses new attributes OR old [Serializable] attributes, but the serializer itself does not implement IFormatter where some of the other WCF serializers do. Opt IN.

  • NetDataContractSerializer – uses new attributes OR old, serializer implements IFormatter, is compatible with WCF, and is Opt IN. Seems like the ideal solution!

  • XmlSerializer – totally independant set of attributes, but is legacy so can forgive this.

  • BinaryFormatter – implements IFormatter and uses the [Serializable] attributes. Opt OUT.

So my question is, why does DataContractSerializer not stay at least fairly interchangable with BinaryFormatter?

I really wish they’d settled on a nice clean interface for this from the start, its a shame really in the expanse of the .NET framework which is usually so ordered!

Edit: Just for those who are interested (I know this isnt really relevant to the rest of the topic), I’ve been doing some both time and size benchmarking of what I perceive as the most likely “on-the-wire” serialization methods:

============ Serialization ============

Protobuf     x158,194 39,549 per/sec  1.00
OldFieldbase  x58,191 14,548 per/sec  2.72
Fieldbase     x57,445 14,361 per/sec  2.75
DataContract  x54,611 13,653 per/sec  2.90
Binary        x29,466  7,367 per/sec  5.37
Net           x28,170  7,043 per/sec  5.62
Json          x10,605  2,651 per/sec 14.92

And sizes:

============ SerializationSizes ============

Protobuffers  209 bytes 1.00
Fieldbase     246 bytes 1.18
OldFieldbase  248 bytes 1.19
Json          728 bytes 3.48
DataContract 1227 bytes 5.87
Net          1658 bytes 7.93
Binary       1826 bytes 8.74

NOTE: On a Core2 T9300 (single threaded) + 4GB.

  • 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-13T07:24:58+00:00Added an answer on May 13, 2026 at 7:24 am

    I can think of two possible reasons why DataContractSerializer doesn’t implement IFormatter:

    • performance – DCS was tweaked specifically to be as fast as possible, since WCF relies heavily and frequently on object serialization/deserialization – that’s one of the reasons that the DCS doesn’t support e.g. attributes on XML nodes either; with all that, it’s about 10% faster than XmlSerializer

    • interoperability – remember, WCF was built from the get-go to be as interoperable as it could possibly be – not just .NET to .NET, but interoperable with any number of other systems, like Java, Ruby, – you name it; neither the BinaryFormatter, nor the XmlSerializer, nor the NetDataContractSerializer can be used in an interoperable scenario – they’re all .NET specific and only available and useable from .NET

    This is a common issue – many .NET developers just simply forget that WCF is not a .NET specific and .NET only technology – it has to strive to maintain as much compatibility as possible with lots of other systems that might not offer all the features of .NET. Another case in point is the error handling in WCF – don’t just throw .NET exceptions – those are .NET specific, and don’t mean a thing to a Java client – use SOAP faults in your WCF services! (unless you can be 100% sure that no non-.NET client will ever call your service)

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

Sidebar

Related Questions

No related questions found

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.