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

  • Home
  • SEARCH
  • 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 9001275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:24:52+00:00 2026-06-16T00:24:52+00:00

I have an object with a property implemented like public String Bla {get;set;} After

  • 0

I have an object with a property implemented like

public String Bla {get;set;} 

After changing the implementation to something like

private String _bla;

public String Bla
{
    get { return _bla; }
    set { _bla = value; } 
} 

on deserialzation, this Property comes up empty.

i have lots of serialized data from the old implementation, and would like to load them with the new implementation

is there any way, to change the implentation to be compatible with older binary files?

EDIT:

Some people might run into the same problem, so here’s my hackish solution:

the autogenerated fields have a naming convention that is non-valid c# code:

[CompilerGenerated]
private string <MyField>k__BackingField;

[CompilerGenerated]
public void set_MyField(string value)
{
    this.<MyField>k__BackingField = value;
}

[CompilerGenerated]
public string get_MyField()
{
    return this.<MyField>k__BackingField;
}

the quick and dirty fix for me was to create a private backing field called xMyFieldxK__BackingField in the source,

and patching the serialized binarydata by replacing all occurences of <MyField> with xMyFieldx before deserialisation

  • 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-16T00:24:53+00:00Added an answer on June 16, 2026 at 12:24 am

    Try implementing ISerializable

        [SecurityCritical]
        public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            if (info == null)
                throw new ArgumentNullException("info");
    
            info.AddValue("name of compiler generated field", _bla);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an object with a string[] property. When I assign this as the
I have persistent object, with a string property that often is over 500 charachters.
private List<T> newList; public List<T> NewList { get{return newList;} set{newList = value;} } I
I have an entity like this: public class Person { public string Name {
I have a dependency property on a class inheriting from adorner, like so: public
Say I have a class, User: public class User { private String name; private
So I have an object that implements INotifyPropertyChanged, and I have a property that
I have a TextBox bound to a property of an object which implements IDataErrorInfo
I have an object with a Property of type byte[ , ,*] now i'd
I have an object with a property called name. This object has a sub

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.