[
  {
    "Id": "703232",
    "ThreadId": "280791",
    "Html": "<p>I have simple code:</p>\n<div style=\"color: black; background-color: white;\">\n<pre><span style=\"color: blue;\">Sub</span> UnZipTest()\n\n        <span style=\"color: blue;\">Dim</span> fl <span style=\"color: blue;\">As</span> XElement\n        <span style=\"color: blue;\">Dim</span> ms = <span style=\"color: blue;\">New</span> MemoryStream\n\n        <span style=\"color: blue;\">Using</span> zip = <span style=\"color: blue;\">New</span> ZipFile(<span style=\"color: #a31515;\">\"fl_db.zip\"</span>)\n            <span style=\"color: blue;\">Dim</span> entry = zip(0)\n            entry.Extract(ms)\n        <span style=\"color: blue;\">End</span> <span style=\"color: blue;\">Using</span>\n\n        fl = XElement.Load(ms)\n\n        Console.WriteLine(<span style=\"color: #a31515;\">\"fl has {0} elements\"</span>, fl.Elements.<span style=\"color: blue;\">Count</span>)\n\n<span style=\"color: blue;\">End</span> <span style=\"color: blue;\">Sub</span>\n</pre>\n</div>\n<p>However, <strong>XmlException </strong>error was thrown: <strong>Root element is missing</strong>. I was scratching my head about the reason of exception. I looked at help and read that \"The position on the stream is not reset...\". What was the reason not  to reset the stream's position in Extract method when it throws an error?</p>\n<p>P.S. Also Help says: \"You may want to call stream.Seek() before calling ZipEntry.Extract()\". Why \"before\", when should be \"after\"?</p>",
    "PostedDate": "2011-11-24T21:58:40.423-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]