Hello,
Has anyone tried serializing an ISession instance with a BinaryFormatter, writing to persistent storage, and then opening and deserializing from a different process?
Sergey suggested that we look at the test suites because deserialization works, and I was able to duplicate the success of the test if serialization/deserialization occurred from the same process. But if I tried one from one process and one from another process, I get an exception. The exception is as follows:
System.Runtime.Serialization.SerializationException was unhandled
Message="The object with ID 4 implements the IObjectReference interface for which all dependencies cannot be resolved. The likely cause is two instances of IObjectReference that have a mutual dependency on each other."
Source="mscorlib"
StackTrace:
at System.Runtime.Serialization.ObjectManager.GetCompletionInfo(FixupHolder fixup, ObjectHolder& holder, Object& member, Boolean bThrowIfMissing)
at System.Runtime.Serialization.ObjectManager.CompleteObject(ObjectHolder holder, Boolean bObjectFullyComplete)
at System.Runtime.Serialization.ObjectManager.DoFixups()
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 Console_Application.Program.readFromDisk() in E:\Abe's Documents\Visual Studio 2005\Projects\Apprenda Services\Architectural Tests\Session Serialization.root\Session Serialization\Console Application\Program.cs:line 140
at Console_Application.Program.Main(String[] args) in E:\Abe's Documents\Visual Studio 2005\Projects\Apprenda Services\Architectural Tests\Session Serialization.root\Session Serialization\Console Application\Program.cs:line 20
at System.AppDomain.nExecuteAssembly(Assembly 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)
at System.Threading.ThreadHelper.ThreadStart()
Any ideas why this happens and if there is a way to fix it? Thanks.
|