Deserializing an Object serialized with the Binary Formatter fails when using a different Executable

Jörg Debus 66 Reputation points
2021-02-10T15:07:20.243+00:00

Hi all,
I have a solution in VS 2019 which contains 2 projects coded to produce 2 executables:

  • One has a class that serializes an object with some lists in it.
  • The other uses the same class to deserialize the binary stream generated by the above.

Compiling both cases in one project to one executable, this runs flawlessly.
Compiling identical classes separately into 2 different executables, deserialization crashes, because it searches for the executable used to serialize the stream.

Context: W10 latest, VS 2019 latest, .Net Framework 4.8, C#

Regards
Jörg

.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,126 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Jerry Cai-MSFT 986 Reputation points
    2021-02-18T03:00:08.117+00:00

    Hi,UwePilgram

    What is the error message?

    You can check whether both exes have the required dlls

    And when compiled into two exe files, check whether the calling path is correct.

    Best Regards,
    Jerry Cai


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments