Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
290
UltraExplorerBar - SaveAsBinary - Serialization Error!
posted

Below is the exact code snippet from your help documentation. I use the same to save the layout to a file and reload it back from the file. It always throws a serialization error everytime the save is called.

// Create a file stream to which the layout will be serialized

System.IO.FileStream fileStream = new System.IO.FileStream(@"C:\Layout.bin",

System.IO.FileMode.OpenOrCreate);

// Save the layout to the file that was just created

explorer.SaveAsBinary(fileStream);

// Close the file stream

fileStream.Close();

Exception:

 explorer.SaveAsBinary(fileStream) 'explorer.SaveAsBinary(fileStream)' threw an exception of type 'System.ApplicationException' void {System.ApplicationException}

  base {"Serialization error!"} System.Exception {System.ApplicationException}
  Inner Exception:  "Object reference not set to an instance of an object."

  Stack Trace:

 at Infragistics.Win.UltraWinExplorerBar.UltraExplorerBarItem.ShouldSerializeToolTipText()
   at Infragistics.Win.UltraWinExplorerBar.UltraExplorerBarItem.System.Runtime.Serialization.ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
   at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter)
   at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter)
   at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo)
   at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[ inHeaders, __BinaryWriter serWriter, Boolean fCheck)
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[ headers, Boolean fCheck)
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph)
   at Infragistics.Win.UltraWinExplorerBar.UltraExplorerBar.SaveHelper(Stream stream, Boolean saveAsBinary)

Any help will be greatly appreciated.