[Mono-bugs] [Bug 75344][Wis] New - SerializationException reading .resx file

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Jun 21 15:59:09 EDT 2005


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by karl at waclawek.net.

http://bugzilla.ximian.com/show_bug.cgi?id=75344

--- shadow/75344	2005-06-21 15:59:09.000000000 -0400
+++ shadow/75344.tmp.3579	2005-06-21 15:59:09.000000000 -0400
@@ -0,0 +1,98 @@
+Bug#: 75344
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: Redhat 9
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: karl at waclawek.net               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: SerializationException reading .resx file
+
+Description of Problem:
+
+I wrote a small routine to convert .resx files to .resources format.
+It used to work on mono 1.1.4, but stopped working now on version 1.1.8.
+It is part of the build scripts for "SAX for .NET".
+
+This is the code
+
+   /// <summary>
+
+    /// Converts resource file from .resx format to .resources format.
+
+    /// </summary>
+
+    /// <param name="resxSource">Fully qualified source file name.</param>
+
+    /// <param name="resourceTarget">Fully qualified target file name.</param>
+
+    public static void ConvertResources(string resxSource, string
+resourceTarget)
+
+    {
+
+      ResXResourceReader reader = new ResXResourceReader(resxSource);
+
+      IDictionaryEnumerator resEnum = reader.GetEnumerator();
+
+      ResourceWriter resWriter = new ResourceWriter(resourceTarget);
+
+      while (resEnum.MoveNext())
+
+        resWriter.AddResource((string)resEnum.Key, resEnum.Value);
+
+      resWriter.Close();
+
+    }
+
+
+Steps to reproduce the problem:
+Call routine with attached MainFrm.resx file.
+
+Actual Results:
+
+Unhandled Exception: System.Runtime.Serialization.SerializationException:
+Unexpected binary element: 0
+in [0x001a0] (at
+/tmp/scratch/BUILD/mono-1.1.8/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs:226)
+System.Runtime.Serialization.Formatters.Binary.ObjectReader:ReadObject
+(BinaryElement element, System.IO.BinaryReader reader, System.Int64
+objectId, System.Object value,
+System.Runtime.Serialization.SerializationInfo info)
+in [0x00034] (at
+/tmp/scratch/BUILD/mono-1.1.8/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs:126)
+System.Runtime.Serialization.Formatters.Binary.ObjectReader:ReadNextObject
+(System.IO.BinaryReader reader)
+in [0x00046] (at
+/tmp/scratch/BUILD/mono-1.1.8/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs:107)
+System.Runtime.Serialization.Formatters.Binary.ObjectReader:ReadObjectGraph
+(System.IO.BinaryReader reader, Boolean readHeaders, System.Object result,
+System.Runtime.Remoting.Messaging.Header[] headers)
+in [0x00080] (at
+/tmp/scratch/BUILD/mono-1.1.8/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryFormatter.cs:163)
+System.Runtime.Serialization.Formatters.Binary.BinaryFormatter:Deserialize
+(System.IO.Stream serializationStream,
+System.Runtime.Remoting.Messaging.HeaderHandler handler)
+in [0x00003] (at
+/tmp/scratch/BUILD/mono-1.1.8/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryFormatter.cs:127)
+System.Runtime.Serialization.Formatters.Binary.BinaryFormatter:Deserialize
+(System.IO.Stream serializationStream)
+in [0x00143] (at
+/tmp/scratch/BUILD/mono-1.1.8/mcs/class/Managed.Windows.Forms/System.Resources/ResXResourceReader.cs:213)
+System.Resources.ResXResourceReader:load_data ()
+in [0x00033] (at
+/tmp/scratch/BUILD/mono-1.1.8/mcs/class/Managed.Windows.Forms/System.Resources/ResXResourceReader.cs:105)
+System.Resources.ResXResourceReader:basic_setup ()
+in [0x00013] (at
+/tmp/scratch/BUILD/mono-1.1.8/mcs/class/Managed.Windows.Forms/System.Resources/ResXResourceReader.cs:73)
+System.Resources.ResXResourceReader:.ctor (System.String fileName)
+in <0x0002c> Build.BaseBuilder:ConvertResources (System.String resxSource,
+System.String resourceTarget)


More information about the mono-bugs mailing list