How to find out where the IsolatedStorage is in a Windows Phone 7 app?

DZone 's Guide to

How to find out where the IsolatedStorage is in a Windows Phone 7 app?

· ·
Free Resource

Experienced Windows Phone 7 developers already know that there is an actual file system on the device that is similiar structure-wise to that of the actual Windows OS. A lot of the content managed by the device is stored in local spots scattered across the system that are not publicly disclosed (although since the OS image was already disassembled, most of them are known).

One of these locations is the folder that is designated as the isolated storage for a specific application. It is fairly easy to access it via the default System.IO.IsolatedStorage classes, but it is also possible to get the actual location of the folder that is assigned to the app.

To do this, simply add this line to your program:

IsolatedStorageFile file = IsolatedStorageFile.GetUserStoreForApplication();

Set a breakpoint to a line that goes after the one above, so that file becomes an actual instance. Once the breakpoint is hit, look at the data related to file, specifically at the m_AppFilesPath field:

If you save anything in the isolated storage, you can access the resource from inside your application by using an absolute URL. The access to this resource is currently only limited to the application context - even if you know the folder for another isolated storage, you cannot access it from an application it is not assigned to. It seems to me like there is an owner policy enforced, but I am looking into that.

You can use this method to easily load resources (e.g. images):

BitmapImage image = new BitmapImage(new Uri("file://Applications/Data/4FFA38B5-00AF-4760-A7EB-7C0C0BC1D31A/Data/IsolatedStore/image.jpg"));



Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}