Creating a file in isolated storage

Posted on 2009-07-08
Last Modified: 2013-12-17
The following example from .NET Framework 2.on page135 gives 3 errors.
What have I done wrongZ?
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.IO.IsolatedStorage;
class Program
  static void Main(string[] args)
    // Create a Store for the current user
    IsolatedStorageFile userStore = IsolatedStorageFile.GetUserStoreForAssembly();
    IsolatedStorageFileStream userStream = new IsolatedStorageFileStream("UserSettings.set", FileMode.Create, userStore);
    StreamWriter userWriter = new StreamWriter(userStream);
    userWriter.WriteLine("User Prefs");

Open in new window

Question by:AstroGuy
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2

Expert Comment

ID: 24804334
Which errors do you get? Did you create a console application to implement the example?
I ran this code in Visual Studio 2008 with framework 2.0 without any errors.

Author Comment

ID: 24805080
Yes I used a console application.  I received the following compile errors as the attached screenshot shows.

Accepted Solution

mysteriousguy earned 500 total points
ID: 24805406
You made a mistake in spelling of IsolatedStorageFileStream.

Author Closing Comment

ID: 31601118
Very good eye mysteriousguy.  Thanks. BTW this code was originally cut and pasted from the text.

Featured Post

More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK ( for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question