StreamWriter.Write or WriteLine causes Session_End

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: xuxu (renzoes_at_excite.com)
Date: 06/08/04


Date: 7 Jun 2004 19:01:42 -0700

If you use StreamWrite Write or WriteLine it causes Session to End!
e.g.
    FileStream fs = File.Open(fileName,FileMode.Append,FileAccess.Write);
   StreamWriter sw = new StreamWriter(fs);
   sw.Write("test");
   sw.Close();
   fs.Close();

Now all session information is lost!!
Is there a work around for this ?



Relevant Pages