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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:27:28+00:00 2026-05-25T13:27:28+00:00

As it was mentioned in previous posts , when a List of objects (member

  • 0

As it was mentioned in previous posts, when a List of objects (member of a bigger object) is marked with the AsReference attribute, its elements are indeed serialized/deserialized as reference. However
the list itself isn’t serialized as reference. This behavior breaks the integrity of the object graph. In particular, it is different from what the MS BinaryFormatter does. I wonder where does this limitation come from and what would it take to have it as an optional feature?

I evaluate migrating a huge ASP.NET app with an SQL state session from the BinaryFormatter to ProtoBuf-net serialization in order to improve performance. The application has a fairly
complicated data model all saved in the Session, so the above seems to be a potential for bugs. By the way, can you recall other significant differences in behavior between the BinaryFormmater and ProtoBuf.net?

  • 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-25T13:27:29+00:00Added an answer on May 25, 2026 at 1:27 pm

    The “what would it take” is simply me getting a few minutes to design, implement (twice: runtime vs meta-programming), unit-test (twice: runtime vs MP), regression-test (twice…), document, deploy, etc. It isn’t a huge thing

    A pragmatic option may be to encapsulate the list, so that you don’t directly need to reference the list – i.e. instead of:

    objA                 objB
    > theList            > theList
    

    you might have

    objA                 objB               listWrapper
    > listWrapper        > listWrapper      > theList
    

    that is obvious not vastly convenient, but it would work today. Support for this scenario is on my road-map, though.

    Re other significant differences… it depends entirely on what your state model is (and in either case I recommend a reasonably simple DTO model here). But things that leap to mind:

    • it may be using a different constructor (note: you can disable constructor usage in protobuf-net, as an option)
    • depending on how you mark the members, you might be working at property level (BinaryFormatter is field level; protobuf-net can also work at field-level if desired)
    • protobuf-net doesn’t have as much support for unexpected types (although DynamicType is an option in some scenarios); generally it prefers to know what the data is going to look like in advance
    • protobuf-net doesn’t serialize delegates/events (BinaryFormatter does)
    • reference tracking is explicit (opt-in) in protobuf-net, and implicit (automatic) in BinaryFormatter
    • and probably a few other things that would occur if I saw the model
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've heard DOM level 2 and DOM level 3 mentioned in previous posts .
As I have mentioned in a few previous posts I am creating a minecraft
As I've mentioned in a previous question , I'm looking into migrating our source
As mentioned in many of my previous questions, I'm working through K&R, and am
In a previous SO question, it was mentioned that USB devices can be mounted
In a previous post it was mentioned that an overload of the Select method
I have a model with 3 properties, as I mentioned in a previous question
The VXML application I mentioned in a previous question is now in testing. After
I read some useful posts here on SO about previous maven questions, I'm currently
In a previous question I mentioned some work with a 3rd party DLL whose

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.