Error that eventually cause WP 7.1 application to be started

Oct 13, 2012 at 9:54 PM
Edited Oct 13, 2012 at 9:55 PM

After spent many months of wp 7.1 app development, I am now testing my app.I am using sterling latest version from NuGet. Unfortunately, app throws following errors and after several run and errror, it stops opening running again. Only way to recover from this error  is  to un / re-install the app. I followed all best practices for coding for sterling that were suggested sterling documentation and discussion (i.e Flush after save):

System.IO.EndOfStreamException: Unable to read beyond the end of the stream.\r\n   at System.IO.__Error.EndOfFile()\r\n   at System.IO.BinaryReader.FillBuffer(Int32 numBytes)\r\n   at System.IO.BinaryReader.ReadUInt16()\r\n   at Wintellect.Sterling.Serialization.SerializationHelper._DeserializeNull(BinaryReader br)\r\n   at Wintellect.Sterling.Serialization.SerializationHelper.Load(Type type, Object key, BinaryReader br, CycleCache cache)\r\n   at Wintellect.Sterling.Database.BaseDatabaseInstance.Load(Type type, Object key, CycleCache cache)\r\n   at Wintellect.Sterling.Database.BaseDatabaseInstance.Load(Type type, Object key)\r\n   at Wintellect.Sterling.Database.BaseDatabaseInstance.Load[T,TKey](Int64 key)\r\n   at Wintellect.Sterling.Keys.TableKey`2.<.ctor>b__0()\r\n   at System.Lazy`1.get_Value()\r\n   at System.Threading.ThreadPool.WorkItem.WaitCallback_Context(Object state)\r\n   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n   at System.Threading.ThreadPool.WorkItem.doWork(Object o)\r\n   at System.Threading.Timer.ring()\r\n"


Please help me. I tried all possible things , nothing helps.


Oct 15, 2012 at 6:46 PM
Edited Oct 15, 2012 at 7:05 PM

This exception can be thrown if two instances of application (2 x Silverlight on Windows 7 Desktop) read and write to one an the same file in isolated storage (i mean, sterling does it). If one of the sessions changed the isolated storage, the read access of the other instance thow an exception like "Unable to read beyond the end of the stream". I think, on Windows Phone it can be the same problem. Use one instance if possible. I hope it helps.    

Last Update: 

Oct 15, 2012 at 9:57 PM

Many thanks argonix.

I will do so that only one instances of my WP 7.1 application is allowed to run. I will check and update you. I really appreciate your comment.Thanks once again.