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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T12:04:54+00:00 2026-06-02T12:04:54+00:00

I have a lot of serialized objects saved as XML, but I would like

  • 0

I have a lot of serialized objects saved as XML, but I would like to add 2 variables to these objects.

Here is my object:

public class MyObject{
    public Int32 MyVariables = 0;
}

This object has been serialized quite a bit, and I want keep the ability to read these “older” files into my application.

But I need to add a few more variables to make the object better, such as:

public class MyObject{
    public Int32 MyVariables = 0;
    public Dictionary<string,MyEnum> MyDict = new Dictionary<string,MyEnum>();
}

Can anyone suggest the best method to add these new variables? I actually changed MyObject and added the dictionary and I believe it is no longer being read in properly.

Thanks in advance!

Edit: I’m also not able to catch an exception anywhere to see where it fails when reading in the object, I’m doing this to do so:

System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
object obj = formatter.Deserialize(File.Open(Path, FileMode.Open));

Edit 2: I believe this actually may be due to me using an Enum as part of the dictionary, I added [Serializable] above the enum and it still doesn’t work – thoughts?

  • 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-02T12:04:55+00:00Added an answer on June 2, 2026 at 12:04 pm

    Just add the new variables.

    If the XML serializer does not find an appropriate representation for the new variables, it will initialize them with default values.

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

Sidebar

Related Questions

Using DCS I am trying to deserialize objects from XML where the object serialized
We have lot of object with this kind of design : Interface and several
I have a collection containing a LOT of Data Transfer Objects that I need
I am new to doing this sort of thing but I would like to
I have a requirement to use date picker in my applicaiton. I have lot
At the moment, I have lot's of Java which does all kind of nifty
I am creating Excel file download using NOPI libraries. I have lot of data
I am trying to build a data mart. I have lot of dimensions, and
Have a lot of unnecessary results using contains() method in my query. Don't tell
We have a lot of customized spreadsheet solutions that are being used and we

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.