#if DEBUG const string logfile = "demo.log"; try { using (var sw = new System.IO.StreamWriter(System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForApplication().OpenFile(logfile, System.IO.FileMode.Append, System.IO.FileAccess.Write, System.IO.FileShare.Read))) { sw.WriteLine(string.Format("{0} [Demo] {1}", DateTime.Now, "a message")); } } catch (Exception ex) { Debug.WriteLine("Save {0} ERROR!! {1}", logfile, ex); } #endif