Le flux n'était pas une erreur lisible

J'obtiens le message "le Ruisseau n'était pas lisible" sur la déclaration:

using (StreamReader sr = new StreamReader(ms))

J'ai essayé les conseils de posté ici sans succès. Merci pour l'aide.

C'est mon code:

XmlSerializer xmlSerializer = new XmlSerializer(typeof(Conflict));
//Serialize Conflicts array to memorystream as XML
using (MemoryStream ms = new MemoryStream())
{
    using (StreamWriter sw = new StreamWriter(ms))
    {
        foreach (Conflict ct in Conflicts)      
            xmlSerializer.Serialize(sw, ct);

        sw.Flush(); //Site tip
        ms.Position = 0;  //Site tip
    }
    //Retrieve memory stream to string
    using (StreamReader sr = new StreamReader(ms))
    {
        string conflictXml = String.Format(CultureInfo.InvariantCulture, "{0}</NewDataSet>",

source d'informationauteur Arnold Krohn