CurrentSize Property

IsolatedStorageFile.CurrentSize Property

Note: This API is now obsolete.

Gets the current size of the isolated storage.

This API is not CLS-compliant. 

Namespace:  System.IO.IsolatedStorage
Assembly:  mscorlib (in mscorlib.dll)

[ObsoleteAttribute("IsolatedStorageFile.CurrentSize has been deprecated because it is not CLS Compliant.  To get the current size use IsolatedStorageFile.UsedSize")]
public override ulong CurrentSize { get; }

Property Value

Type: System.UInt64
The total number of bytes of storage currently in use within the isolated storage scope.


The property is unavailable. The current store has a roaming scope or is not open.


The current object size is undefined.

Represents the total usage of all files and directories within the isolated storage scope.

The current size cannot be accurately determined for stores that are participating in a roaming user profile. Because roaming profiles are often cached on multiple client machines and later synchronized with a server, quotas cannot be enforced for such stores and the current size is not reported.

The How to: Anticipate Out-of-Space Conditions with Isolated Storage example demonstrates the use of the CurrentSize property.

The following code example demonstrates the CurrentSize property. For the complete context of this example, see the IsolatedStorageFile overview.

StreamWriter writer = new StreamWriter(isoStream);
// Update the data based on the new inputs.

// Calculate the amount of space used to record this user's preferences.
double d = isoFile.CurrentSize / isoFile.MaximumSize;
Console.WriteLine("CurrentSize = " + isoFile.CurrentSize.ToString());
Console.WriteLine("MaximumSize = " + isoFile.MaximumSize.ToString());

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
Obsolete (compiler warning) in 4

.NET Framework Client Profile

Supported in: 3.5 SP1
Obsolete (compiler warning) in 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

© 2015 Microsoft