22
Answers

StreamReader/StreamWriter

George George

George George

16y
16.3k
1

Hello everyone,


I understand there is no need to call Dispose explicitly when dealing with StreamReader/StreamWriter object instances since GC will take care of it in Finalizer method.

My question is, I want to know the benefits and potential issues of using "using" statement to deal with StreamReader/StreamWriter.


thanks in advance,
George

Answers (22)
0
Sujeet Singh
NA 129 0 7y
this is usually means one of two things:
  1. There is some very unusual code path which, when taken, always causes a crash
  2. A race condition exists between threads in your program. Thus, the crash appears unpredictably and may be difficult to reproduce

My advice to you is to start the program in the debugger, and leave it running until the exception is thrown. Then you can come back here and provide us with the relevant code, stack trace, debug output, etc.