System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForApplication Method

Obtains user-scoped isolated storage corresponding to the calling code's application identity.

Syntax

public static IsolatedStorageFile GetUserStoreForApplication ()

Returns

An object corresponding to the isolated storage scope based on the calling code's assembly identity.

Remarks

All assemblies associated with an application use the same isolated store when using this method. This method can be used only when the application identity can be determined - for example, when the application is published through ClickOnce deployment or is a Silverlight-based application. If you attempt to use this method outside a ClickOnce or Silverlight-based application, you will receive an System.IO.IsolatedStorage.IsolatedStorageException exception, because the application identity of the caller cannot be determined.

IsolatedStorageFile.GetUserStoreForApplication is functionally equivalent to the following code:

code reference: System.IO.IsolatedStorage.IsolatedStorage#21

In this code, the applicationIdentity parameter for GetStore(IsolatedStorageScope scope, Object applicationIdentity) is null.

Requirements

Namespace: System.IO.IsolatedStorage
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0