Isolated storage introduced a new scope in v2.0 of the CLR to work with ClickOnce applications. Application scoped Isolated storage is backed by the application’s data directory. This enables scenarios where your isolated storage data will flow forward with your application as ClickOnce updates it to new versions.
However, in order to take advantage of this, you need to be sure you’re using the application scope. The default IsolatedStorageFileStream constructor will actually use domain scope, even if you are running in a ClickOnce application. (One design decision we could have made might have been to detect if this is a ClickOnce application and default to application scope, however this would lead to the situation where the program would have subtly different behavior if it was run as a standalone application.)
Since the default constructor is using domain scope, you might observe that as your application upgrades it appears that the files you stored in your isolated storage disappear. Because of this behavior, you’ll want to specify that you’d like to use application scoped storage instead of domain scoped storage:
using(IsolatedStorageFileStream stream = new IsolatedStorageFileStream(“data.dat”, FileMode.OpenOrCreate, scope))
Note that application scoped isolated storage is only available if your program is running as a ClickOnce application. If it is not, you’ll get an IsolatedStorageException when you call GetUserStoreForApplication which says “Unable to determine the application identity of the caller.”