So, some things look wrong.
fileStream.Read(byXML, 0, postedFile.ContentLength);
This line reads the file into the byXML byte buffer, but later you do not use this byte buffer, so I think you wanted to delete this line or use the byXML buffer for your XmlDocument.Load () instead of fileStream.
This line, unfortunately, pushes your thread to the end, so when you call
xmlProjPlan.Load(fileStream);
He does not receive anything, because the flow is already at the end. This is probably why he cannot find the root element.
source share