Microsoft KB Archive/927495

= FIX: Error message when you use a serialization surrogate to serialize XML data or to deserialize XML data in the .NET Framework 1.1: &quot;The object with ID 3 was referenced in a fixup but does not exist&quot; =

Article ID: 927495

Article Last Modified on 10/26/2007

-

APPLIES TO


 * Microsoft .NET Framework 1.1

-



SYMPTOMS
Consider the following scenario. In a Microsoft .NET Framework 1.1-based application, you set two objects to reference one another. You use a serialization surrogate to serialize XML data or to deserialize XML data. You compile the application. In this scenario, a SerializationException exception occurs. Additionally, you receive the following error message:

The object with ID 3 was referenced in a fixup but does not exist.

This problem occurs if one of the following conditions is true:  You have installed the hotfix that is described in the following Microsoft Knowledge Base article:

893251 FIX: Errors may occur when you use the BinaryFormatter class or the SoapFormatter class to serialize an object in the .NET Framework 1.1

 You have Microsoft Windows Server 2003 Service Pack 2 (SP2) installed. You have installed a .NET Framework 1.1 hotfix that changes the Mscorlib.dll file. The version of the Mscorlib.dll file is 1.1.4322.2310 or a later version. In Windows Server 2003, the version of the Mscorlib.dll file is also earlier than 1.1.4322.2407. In other versions of Windows, the version of the Mscorlib.dll file is also earlier than 1.1.4322.2402.



Hotfix information
A supported hotfix is now available from Microsoft. However, it is intended to correct only the problem that is described in this article. Apply it only to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Windows Server 2003 service pack or the next .NET Framework 1.1 service pack that contains this hotfix.

To resolve this problem immediately, contact Microsoft Customer Support Services to obtain the hotfix. For a complete list of Microsoft Customer Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:

http://support.microsoft.com/contactus/?ws=support

Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.Note After you install this hotfix, you must change the application. For more information, see the &quot;More information&quot; section.

Prerequisites
You must have the .NET Framework 1.1 SP1 installed to apply this hotfix. If you run the application in Windows Server 2003, you must have Windows Server 2003 SP2 installed to apply this hotfix.

Restart requirement
You do not have to restart the computer after you apply this hotfix.

Hotfix replacement information
This hotfix replaces the hotfix that is described in the following Microsoft Knowledge Base article:

893251 FIX: Errors may occur when you use the BinaryFormatter class or the SoapFormatter class to serialize an object in the .NET Framework 1.1

File information
The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.

Microsoft .NET Framework 1.1


STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.



MORE INFORMATION
This hotfix adds a new method that is called GetSurrogateForCyclicalReference to the FormatterServices class. To resolve the problem that is described in the &quot;Symptoms&quot; section, you must use the GetSurrogateForCyclicalReference method to return a serialization surrogate. The serialization surrogate can handle the cyclical references that cause the problem. The following sample code shows how the new method is used: class Program {   static void Main(string[] args) {    MemoryStream ms = new MemoryStream; BinaryFormatter formatter = new BinaryFormatter; formatter.AssemblyFormat = FormatterAssemblyStyle.Simple; SurrogateSelector ss = new SurrogateSelector; ss.AddSurrogate(typeof(TypeA),                    new StreamingContext(StreamingContextStates.All),                     FormatterServices.GetSurrogateForCyclicalReference(new TypeASerializationSurrogate)); // (*) formatter.SurrogateSelector = ss;

TypeA a = new TypeA; TypeB b = new TypeB; a.RefB = b;    b.RefA = a;     formatter.Serialize(ms, a); ms.Seek(0, SeekOrigin.Begin); formatter.Deserialize(ms); } } For more information, 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

