SerializationException: End of Stream encountered before parsing was completed

getting this error

SerializationException: End of Stream encountered before parsing was completed.
System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run () (at :0)
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize (System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Runtime.Serialization.Formatters.Binary.__BinaryParser serParser, System.Boolean fCheck, System.Boolean isCrossAppDomain, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) (at :0)
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Boolean fCheck, System.Boolean isCrossAppDomain, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) (at :0)
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Boolean fCheck, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) (at :0)
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Boolean fCheck) (at :0)
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler) (at :0)
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream) (at :0)
RPG.MySaving.SavingSystem.LoadFile (System.String saveFile) (at Assets/Scripts/Saving/MySavings/SavingSystem.cs:92)
RPG.MySaving.SavingSystem+d__0.MoveNext () (at Assets/Scripts/Saving/MySavings/SavingSystem.cs:26)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Scripting/Coroutines.cs:17)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
RPG.SceneManagement.SavingWrapper:Awake() (at Assets/Scripts/Scene management/SavingWrapper.cs:17)
UnityEngine.Object:Instantiate(GameObject)
RPG.Core.PersistentObjectSpwaner:SoawnPersistentObjects() (at Assets/Scripts/Core/PersistentObjectSpwaner.cs:26)
RPG.Core.PersistentObjectSpwaner:Awake() (at Assets/Scripts/Core/PersistentObjectSpwaner.cs:19)

If you made any changes of significance to the data you are saving/loading, existing saved files may now have an incompatible format.

Can you temporarily move all of your saved files out and see if saving and loading then works OK?

Each time you make such a change to the file’s “format” of the structure being saved and loading, you will need to erase the old saved files and start over. At least for now in this simple scenario.

1 Like

Tnx

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms