Error Encountered with Byte Arrays

Topics: Developer Forum, User Forum
Oct 6, 2011 at 3:35 PM

Hi,

Whilst evaluating SharedCache and attempting to work with Byte arrays (only because I am using MultiAdd), when I try to 'Get' a cached value I get the following error:

System.Runtime.Serialization.SerializationException was unhandled
  Message=End of Stream encountered before parsing was completed.
  Source=mscorlib
  StackTrace:
       at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
       at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
       at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
       at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream)
       at SharedCache.WinServiceCommon.Formatters.Serialization.BinaryDeSerialize[T](Byte[] serializedObject)
       at SharedCache.WinServiceCommon.Provider.Cache.IndexusSharedCacheProvider.Get[T](String key)
       at System.Runtime.Caching.Module1.AddToSharedCache() in C:\Users\simon.miles\documents\visual studio 2010\Projects\System.Runtime.Caching\System.Runtime.Caching\Module1.vb:line 161
       at System.Runtime.Caching.Module1.Main() in C:\Users\simon.miles\documents\visual studio 2010\Projects\System.Runtime.Caching\System.Runtime.Caching\Module1.vb:line 18
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:

Any ideas?

Thanks, Simon.