© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•10mo ago•
38 replies
osadriofary

Serialization and retrocompatibility

Hi. So i'm working on a client that communicates with a server using serialization. I need the old client to be able to communicate with the new server.

My problem is some of the fields in my app were created with auto properties (get; set;) way. And i now have to change them to private _id and public Id.

I've looked around and found that for the auto properties, the compiler Will create a private field called <Id>kBackingField. This property is used for serialization.

For now i've been using a custom serialization where i create the <nameof(Id)>k
BackingField.

This isnt very pretty and i've also Just discovered it gets even worse with inheritance. Is there a way to fix this retrocompatibility problem in an easier way ?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Serialization and Deserialization Issues
C#CC# / help
3y ago
Serialization/Deserialization
C#CC# / help
2y ago
✅ XML Serialization
C#CC# / help
4y ago
✅ Question about serialization
C#CC# / help
7mo ago