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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:07:56+00:00 2026-06-05T17:07:56+00:00

I follow this tutorial online exactly but somehow it’s giving me errors. Saying there

  • 0

I follow this tutorial online exactly but somehow it’s giving me errors. Saying there is no object map or something.

I have the following static object that I want to serialize:

[Serializable]
public class Settings : ISerializable 
{
    public static string server= "http://localhost/";
    public static string username = "myname";
    public static bool savePassword = true;
    public static bool autoSync = true;
    public static string password = "mypass";
    public static string folderPath1= "c:/";
    public static string folderPath2= "c:/";
    public static string autoSyncDuration = "300";
    public static string lastSyncTime = "???";


    public Settings()
    { }

    public void GetObjectData(SerializationInfo info, StreamingContext context)
    {
        Type myTypeObj = Type.GetType("Settings");
        foreach (FieldInfo p in myTypeObj.GetFields())
        {
            Object value = p.GetValue(null);
            info.AddValue(p.Name, value, p.GetType());
        }
    }

    public Settings(SerializationInfo info, StreamingContext context)
    {
        Type myTypeObj = Type.GetType("Settings");
        FieldInfo p;
        foreach (SerializationEntry e in info)
        {
            p = myTypeObj.GetField(e.Name);
            p.SetValue(null, e.Value);
        }
    }
}

And here is the Read/Write functions:

    private void writeSettings()
    {
        pcb_savingSettings.Visible = true;
        FileStream fileStream = new FileStream(settingFile, FileMode.Create, FileAccess.Write, FileShare.None);
        BinaryFormatter bf = new BinaryFormatter();
        bf.Serialize(fileStream, new Settings());

        fileStream.Close();
        pcb_savingSettings.Visible = false;
    }
    private void readSettings()
    {
        if (!File.Exists(settingFile))
        {
            writeSettings();
        }
        FileStream fileStream = new FileStream(settingFile, FileMode.Open, FileAccess.Read, FileShare.None);
        BinaryFormatter bf = new BinaryFormatter();
        bf.Deserialize(fileStream);
        fileStream.Close();
    }

ACTUAL ERROR MSG: No map for Object ‘822476800’. This occur on this line:

bf.Deserialize(fileStream);
  • 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-05T17:08:01+00:00Added an answer on June 5, 2026 at 5:08 pm

    I figure out what the error is for those in future who might be banging their head wondering what went wrong. It’s actually really simple. A small typo actually. Too bad M$ have horrible error message that don’t really tell you where the error might have happened:

    Simply replace this line:

    public void GetObjectData(SerializationInfo info, StreamingContext context)
    {
        Type myTypeObj = Type.GetType("Settings");
        foreach (FieldInfo p in myTypeObj.GetFields())
        {
            Object value = p.GetValue(null);
            info.AddValue(p.Name, value, p.GetType());
        }
    }
    

    With this:

        public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            Type myTypeObj = Type.GetType("Settings");
            foreach (FieldInfo p in myTypeObj.GetFields())
            {
                Object value = p.GetValue(null);
                info.AddValue(p.Name, value, value.GetType());
            }
        }
    

    And that’s it! Everything serialize/de-serialize just fine. You can’t possibly guess where it went wrong with the error msg: * No map for Object ‘822476800’*.

    Note: In the last line, p.GetType should be value.GetType

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

Sidebar

Related Questions

I want to include Core Location and I'm trying to follow this tutorial: http://www.mobileorchard.com/hello-there-a-corelocation-tutorial/
I'm trying to follow this tutorial but instead of generating the expected hbm.xml files
I'm trying to follow this tutorial here but the tutorial seems to use this
I am trying to follow this tutorial http://damianm.com/tech/nhibernate-mvc-and-ninject/ but I am running into some
I'm trying to follow this tutorial but with the immediate window in vs2010 rather
I'm trying to follow this tutorial. I've got a non empty db. But the
I'm trying to follow this tutorial, but VS debugger keep asking me for a
I tried to follow this tutorial but couldn't find File entry in properties windows.
Trying to follow this tutorial, but my installation of mysql is failing. After getting
I tried to follow this tutorial to deploy my jruby app on tomcat, but

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.