This documentation is archived and is not being maintained.

IsolatedStorageFile.MaximumSize Property

Note: This API is now obsolete. The non-obsolete alternative is Quota.

Gets a value representing the maximum amount of space available for isolated storage within the limits established by the quota.

This API is not CLS-compliant. 

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

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

Property Value

Type: System.UInt64
The limit of isolated storage space in bytes.


The property is unavailable. MaximumSize cannot be determined without evidence from the assembly's creation. The evidence could not be determined when the object was created.


An isolated storage error occurred.

The number of bytes available is constrained by the isolated storage quota set by the administrator. Quota is configured in security policy on the basis of evidence, so the same code can receive a different quota if it is run with different evidence. For example, an application that is run locally and also from a share on an intranet would likely receive different quotas.

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

The following code example demonstrates the MaximumSize 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.