Does anyone use the .NET System.IO.IsolatedStorage?

I read about the System.IO.IsolatedStorage namespace in .NET and found that I could use it to store the file in a place unique to my build or executable. For example, the following code:

using System.IO.IsolatedStorage; public class Program { static void Main(string[] args) { IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForAssembly(); store.CreateFile("myUserFile.txt"); } } 

Creates the file "myUserFile.txt" in the following location:

C: \ Users \ Nickname \ AppData \ Local \ IsolatedStorage \ bhxcjtkp.bpv \ wbjkcolm.3br \ StrongName.m2s0saaun2onmow3pd5pkml30lf2dobr \ AssemFiles

And using IsolatedStorageFile.GetMachineStoreForAssembly() creates a similar directory structure in C: \ ProgramData \ IsolatedStorage.

I see that you can let this API create a repository for you (no need to invent the path to the file yourself). But I was surprised to see that there were no other files stored in IsolStorage from other third-party applications (at least not on my computer).

Instead, I found quite a few programs that store configuration files, and simply in C: \ Users \ Nick \ AppData \ Local. Does anyone know why software vendors might shy away from using IsolStorage? Or do they use a different API that stores files in AppData?

+8
c # isolatedstorage
source share
2 answers

One of the reasons we found (the hard way) is because the algorithm used by applications to determine the path to use in isolated storage depends on the version of the application. Installing a new version of the application makes it impossible to access previously saved data. I am sure that there are options for this scenario to work, but we could not find them and simply moved to a permanent storage path.

+5
source share

Sandbox storage is ideal for applications and user settings, as well as for such data. By โ€œdata like thisโ€ I mean data that is not critical to applications (for the reasons you saw), but itโ€™s useful to avoid the eyes of users.

It is very simple to clean up isolated storage, so expect it to always be and you will not be disappointed.

+1
source share