[Mono-bugs] [Bug 81849][Cri] Changed - IsolatedStorage not working properly.

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Jun 12 15:28:30 EDT 2007


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by xcap2000 at gmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=81849

--- shadow/81849	2007-06-10 16:20:33.000000000 -0400
+++ shadow/81849.tmp.702	2007-06-12 15:28:30.000000000 -0400
@@ -136,6 +136,88 @@
 		return res;
 	}
 
 }
 
 
+
+------- Additional Comments From xcap2000 at gmail.com  2007-06-12 15:28 -------
+Make sure to clear the isolatedstorage with storeadm.exe:
+
+
+using System;
+using System.IO;
+using System.IO.IsolatedStorage;
+
+class Test
+{
+	static void Main()
+	{
+		Write("Line 1\nLine 2\nLine 3\nLine 4\nLine 5\nLine 6");
+		Console.WriteLine("old value was:\n{0}", Read());
+		Write("Line 1\nLine 2\nLine 4\nLine 5\nLine 6");
+		Console.WriteLine("new value is:\n{0}", Read());
+	}
+
+	static void Write(string line)
+	{
+		IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForDomain();
+		Stream stm = new IsolatedStorageFileStream("test.txt",
+FileMode.OpenOrCreate, isf);
+		TextWriter tw = new StreamWriter(stm);
+		tw.WriteLine(line);
+		tw.Close();
+		stm.Close();
+		isf.Close();
+	}
+
+	static string Read()
+	{
+		IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForDomain();
+		Stream stm = new IsolatedStorageFileStream("test.txt",
+FileMode.OpenOrCreate, isf);
+		TextReader r = new StreamReader(stm);
+		string res = r.ReadToEnd();
+		r.Close();
+		stm.Close();
+		isf.Close();
+		return res;
+	}
+}
+
+The results are:
+
+old value was:
+Line 1
+Line 2
+Line 3
+Line 4
+Line 5
+Line 6
+
+new value is:
+Line 1
+Line 2
+Line 4
+Line 5
+Line 6
+Line 6
+
+When should be:
+
+old value was:
+Line 1
+Line 2
+Line 3
+Line 4
+Line 5
+Line 6
+
+new value is:
+Line 1
+Line 2
+Line 4
+Line 5
+Line 6
+
+The last line does not exist anymore...
+


More information about the mono-bugs mailing list