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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:12:11+00:00 2026-05-11T06:12:11+00:00

We have a huge client/server WinForms app that uses .NET remoting to pass DAOs

  • 0

We have a huge client/server WinForms app that uses .NET remoting to pass DAOs between the layers, which has a few problems.

  1. All of the DAOs were defined to use fields instead of properties long before I got here, and you can’t bind fields to controls.
  2. Adding fields or properties to a DAO changes the serialization format, requiring a dual client/server deployment, which is much more difficult for us than either a client or server deployment (we have to work around doctors’ schedules to minimize downtime).

Using a simple, contrived, and imaginary example, would changing the object from this:

public class Employee {     public int ID;     public string Name;     public DateTime DateOfBirth; } 

to this:

public class Employee {     public int ID { get; set; }     public string Name { get; set; }     public DateTime DateOfBirth { get; set; } } 

change the serialization format, breaking compatibility with older clients?

  • 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. 2026-05-11T06:12:11+00:00Added an answer on May 11, 2026 at 6:12 am

    Important edit: this should be compatible and allow binding?

    public class Employee {     private int id;     private string name;     private DateTime dateOfBirth;     public int ID { get {return id;} set {id = value;} }     public string Name { get {return name;} set {name = value;} }     public DateTime DateOfBirth { get {return dateOfBirth;}          set {dateOfBirth = value;} } } 

    Certainly worth a try, no?

    Yes, this will cause problems if client/server are out of sync.

    .NET remoting uses BinaryFormatterm which (without a bespoke ISerializable implementation) uses the field names. Using automatic properties breaks the field names.

    As long as you update client and server at the same time, it should work. Another option is to use name-independent serialization, such as protobuf-net. I can provide an example if you want (it supports ISerializable usage).

    (by the way, adding properties should not affect BinaryFormatter, since it is field-based)


    As requested, here’s an example of using protobuf-net to control remoting serialization (taken directly from one of my unit tests); note that this will also be incompatible until both client and server agree, but should withstand changes after that (it is designed to be very extensible). Note that there are lots of ways of using it – either explicit member notation (like data-contracts) or implicit fields (like BinaryFormatter), etc (everything in between)… this is just one way of using it:

    [Serializable, ProtoContract] public sealed class ProtoFragment : ISerializable {     [ProtoMember(1, DataFormat=DataFormat.TwosComplement)]     public int Foo { get; set; }     [ProtoMember(2)]     public float Bar { get; set; }      public ProtoFragment() { }     private ProtoFragment(         SerializationInfo info, StreamingContext context)     {         Serializer.Merge(info, this);     }     void  ISerializable.GetObjectData(         SerializationInfo info, StreamingContext context)     {         Serializer.Serialize(info, this);     } } 

    Here, the bottom 2 methods satisfy ISerializable, and simply pass execution to the protobuf-net engine. The [ProtoMember(...)] defines fields (with unique identification markers). As already stated, it can also infer these, but it is safer (less brittle) to be explicit.

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

Sidebar

Ask A Question

Stats

  • Questions 98k
  • Answers 98k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Where the logic for loading goes is something not really… May 11, 2026 at 7:35 pm
  • Editorial Team
    Editorial Team added an answer Eric Lippert has a series on Immutability in C#, and… May 11, 2026 at 7:35 pm
  • Editorial Team
    Editorial Team added an answer I believe that your guess is correct in how the… May 11, 2026 at 7:35 pm

Related Questions

My company is building an ASP.NET HR application and we have decided to create
Do we really need a server side architecture to create a RIA application? My
I'm trying to move toward TDD, ORM, Mocking, ect. I need a good example
I have a current system which is build as a Windows Application, and does

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.