Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: You receive an exception error message when you use the BinaryFormatter object to serialize and to deserialize a generic type in an assembly in the .NET Framework 2.0 Service Pack 2 or in the .NET Framework 3.5 Service Pack 1


View products that this article applies to.

Symptoms

Consider the following scenario:
  • In the Microsoft .NET Framework 2.0 Service Pack 2 (SP2) or in the Microsoft .NET Framework 3.5 Service Pack 1 (SP1), you use the BinaryFormatter object to serialize and to deserialize a generic type in an assembly.
  • The assembly is shared between the server and the client, and the assembly has a strong name.
  • The build versions of the assembly are different between the server and the client.
In this scenario, you receive one of the following exception error messages when you deserialize the stream of the assembly:
Error message 1
System.Runtime.Serialization.SerializationException: Unable to find assembly.
Error message 2
System.IO.FileLoadException: Could not load file or assembly 'Common, Version=version ID, Culture=neutral, PublicKeyToken=key number or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) If you have registered the assembly in the GAC, you receive the following exception: System.InvalidCastException: Return argument has an invalid type.
Notes
  • This problem does not occur when you use the SoapFormatter object.

  • This problem occurs even if you set the FormatterAssemblyStyle.Simple value when you serialize and deserialize.

↑ Back to the top


Resolution

Hotfix Replacement Information

The hotfix that corresponds to KB960442 has been superseded with the hotfix KB981574, which contains all fixes that were previously included in KB960442. You should use the hotfix KB981574 to fix the issues described in KB960442. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
981574 The splash screen stays open longer than usual when you try to start Excel on a computer that has the .NET Framework 3.5 SP1 installed

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

↑ Back to the top


More Information

For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:
824684 Description of the standard terminology that is used to describe Microsoft software updates

↑ Back to the top


Keywords: kbhotfixserver, kbnotautohotfix, kbhotfixdev, kbexpertiseadvanced, kbqfe, kbsurveynew, kb

↑ Back to the top

Article Info
Article ID : 960442
Revision : 2
Created on : 9/20/2018
Published on : 9/20/2018
Exists online : False
Views : 465