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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:53:09+00:00 2026-05-24T20:53:09+00:00

I use Serialization/DeSerialization Technique. BinaryFormatter class. Each time when new assembly is created the

  • 0

I use Serialization/DeSerialization Technique. BinaryFormatter class.
Each time when new assembly is created the BinaryFormatter can’t Deserialize binary data even if the class structure is the same, but the Assembly version differs.
Is it possible to Deserialize binary buffer with no checking the assembly version if the class structure stays unchanged?

  • 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-05-24T20:53:10+00:00Added an answer on May 24, 2026 at 8:53 pm

    Try this:

    public sealed class CurrentAssemblyDeserializationBinder : SerializationBinder
    {
        public override Type BindToType(string assemblyName, string typeName)
        {
            return Type.GetType(String.Format("{0}, {1}", typeName, Assembly.GetExecutingAssembly().FullName));
        }
    }
    formatter.Binder = new CurrentAssemblyDeserializationBinder();
    formatter.Deserialize(inStream);
    

    Thread Poster Added:

    Yes, it works. Just make sure if any types of System.Generic or other Libs in the binary data are present, then you have to pass them through without changes.
    “ResizableControls” – old Assembly lib’ name, “EntityLib” – new Assembly name.
    Also, the Version number is to be replaced as well, on demand.

    public sealed class CurrentAssemblyDeserializationBinder : SerializationBinder
    {
        public override Type BindToType(string assemblyName, string typeName)
        {
            string name;
            if (assemblyName.Contains("ResizableControl"))
            {
                name = Assembly.GetAssembly(typeof(EntityLib.Pattern)).ToString();
            }
            else
            {
                name = assemblyName;
            }
            return Type.GetType(String.Format("{0}, {1}",
                typeName.Replace("ResizableControl", "EntityLib"), name));
        }
    }
    

    Thanks, it is exactly what I needed.

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

Sidebar

Related Questions

Related: How can I use polymorphism in XML Serialization? I have a class I
What are the possibilities in Android, when I intend to use serialization/deserialization with data?
Is it practical / possible to use serialization to read data from an RSS
I imagine to use XML serialization like this: class Foo { public Foo (string
I'm trying to use the native flex serialization/deserialization process to save/load state of a
a few weeks ago I started to use xsd.exe for create classes for serialization/deserialization
When I serialize an object, I can use the serialVersionUID mechanism at the class
I'm using serialization and deserialization in C# for my Project (which is a Class).
I am developing an interface-driven serialization framework for use with interfaces for data XML
I am planning to use serialization to do clone. I have to make my

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.