Will a using clause close this stream?
I've apparently worked myself into a bad coding habit. Here is an example of the code I've been writing: using(StreamReader sr = new StreamReader(File.Open("somefile.txt", FileMode.Open))) { //read file } File.Move("somefile.txt", "somefile.bak"); //can't move, get exception that I the file is open I thought that because the using clause explicitly called Close() and Dispose() on the StreamReader that the FileStream would be closed as well. The only way I could fix the problem I was having was by changing the above block to this: using(FileStream fs = File.Open("somefile.txt", FileMode.Open))