https://bugzilla.novell.com/show_bug.cgi?id=649464
https://bugzilla.novell.com/show_bug.cgi?id=649464#c0 Summary: System.IO.File.ReadLines disposes the StreamReader in the middle of reading Classification: Mono Product: Mono: Class Libraries Version: 2.8.x Platform: All OS/Version: All Status: NEW Severity: Critical Priority: P5 - None Component: CORLIB AssignedTo: [email protected] ReportedBy: [email protected] QAContact: [email protected] Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.11) Gecko/20101013 Ubuntu/10.04 (lucid) Firefox/3.6.11 Calling System.IO.File.ReadLines results in a System.ObjectDisposedException. No reading is done. I have tried the Mono version of File.cs verbatim under Microsoft .NET and get the exact same result. I believe the StreamReader object is going out of the "using" scope and is being disposed of in the middle of reading because the "yield" statement is used. Reproducible: Always Steps to Reproduce: 1. Call Console.Out.WriteLine(System.IO.File.ReadLines("somefile").Count() + " lines"); Actual Results: Throws exception. Expected Results: Prints number of lines. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. You are the assignee for the bug. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
