Is it true that this does not necessarily mean the stream has been disposed of by code – either in a using or by calling dispose.
The stream could have been closed outside of this code and this exception would still occur?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
So I will make my comment an answer: Yes, a stream could just as well be closed from outside your code, so make sure you check for a
System.ObjectDisposedException.There are several occasions this could happen: imagine for example a stream associated with a network connection and the connection is suddenly interrupted. Depending on the implementation this could close the stream and throw that particular exception if the stream is accessed.