[WCF] referencesource XmlBinaryWriter closes stream by default, so keep it open.
authorAtsushi Eno <atsushieno@gmail.com>
Thu, 16 Apr 2015 17:43:24 +0000 (02:43 +0900)
committerAtsushi Eno <atsushieno@gmail.com>
Fri, 24 Apr 2015 05:36:57 +0000 (14:36 +0900)
Otherwise MemoryStream.Position complains that it is already disposed.

mcs/class/System.ServiceModel/System.ServiceModel.Channels/BinaryMessageEncoder.cs

index ab76a512211bf8114ce564a3ad2d958743a6a9ec..fc379b2e588c954c49948dd5a3c7285d66a6a69f 100644 (file)
@@ -120,7 +120,7 @@ namespace System.ServiceModel.Channels
                {
                        VerifyMessageVersion (message);
 
-                       using (var xw = XmlDictionaryWriter.CreateBinaryWriter (stream, Constants.SoapDictionary, session ? CurrentWriterSession : null))
+                       using (var xw = XmlDictionaryWriter.CreateBinaryWriter (stream, Constants.SoapDictionary, session ? CurrentWriterSession : null, false))
                                message.WriteMessage (xw);
                }