PhilJohnson
IS-IT--Management
Hi,
I am using dotnet remoting with a binarry formatter.
I have a property that returns a memorystream that has had a file loaded
into it.
When I try to access this property though I get an error regarding "the
proxy has no channel sink....[]...or no suitable Client channel to talk to
the server."
I have investigated a bit and have come to the conclusion that the
memorystream object can itself be serialized with a binary formatter, but
when it is deserialized it throws an exception stating that
"End of Stream encountered before parsing was completed."
Can anybody suggest a way around this, or indeed a different way than the
memorystream to pass file data trhough remoting boundaries using the
binaryformatter?
In case its of use, this is the code I used to try out my
serialize/deserialize test...
// SEEMS TO SERIALIZE ok BUT THROWS AN ERROR ON DESIERIALIZE!!!!
BinaryFormatter objSerializer = new BinaryFormatter();
BinaryFormatter objDeserializer = new BinaryFormatter();
FileStream fst = File.OpenRead(Path.GetFullPath(file));
System.IO.MemoryStream objStream = GetMemoryStream(fst);
System.IO.MemoryStream objSerializedStream = new System.IO.MemoryStream();
objSerializer.Serialize(objSerializedStream, objStream);
System.IO.MemoryStream objReturnStream = new System.IO.MemoryStream();
try
{
//objReturnStream =
(MemoryStream)(objDeserializer.Deserialize(objSerializedStream));
object objDeserialisedFile =
objDeserializer.Deserialize(objSerializedStream);
}
catch(Exception ex)
{
MessageBox.Show("Exception: " + ex.Message);
}
--
Regards,
Phil Johnson
I am using dotnet remoting with a binarry formatter.
I have a property that returns a memorystream that has had a file loaded
into it.
When I try to access this property though I get an error regarding "the
proxy has no channel sink....[]...or no suitable Client channel to talk to
the server."
I have investigated a bit and have come to the conclusion that the
memorystream object can itself be serialized with a binary formatter, but
when it is deserialized it throws an exception stating that
"End of Stream encountered before parsing was completed."
Can anybody suggest a way around this, or indeed a different way than the
memorystream to pass file data trhough remoting boundaries using the
binaryformatter?
In case its of use, this is the code I used to try out my
serialize/deserialize test...
// SEEMS TO SERIALIZE ok BUT THROWS AN ERROR ON DESIERIALIZE!!!!
BinaryFormatter objSerializer = new BinaryFormatter();
BinaryFormatter objDeserializer = new BinaryFormatter();
FileStream fst = File.OpenRead(Path.GetFullPath(file));
System.IO.MemoryStream objStream = GetMemoryStream(fst);
System.IO.MemoryStream objSerializedStream = new System.IO.MemoryStream();
objSerializer.Serialize(objSerializedStream, objStream);
System.IO.MemoryStream objReturnStream = new System.IO.MemoryStream();
try
{
//objReturnStream =
(MemoryStream)(objDeserializer.Deserialize(objSerializedStream));
object objDeserialisedFile =
objDeserializer.Deserialize(objSerializedStream);
}
catch(Exception ex)
{
MessageBox.Show("Exception: " + ex.Message);
}
--
Regards,
Phil Johnson