Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IndexOutOfRangeException Class

The exception that is thrown when an attempt is made to access an element of an array with an index that is outside the bounds of the array. This class cannot be inherited.

For a list of all members of this type, see IndexOutOfRangeException Members.


[Visual Basic]
NotInheritable Public Class IndexOutOfRangeException
   Inherits SystemException
public sealed class IndexOutOfRangeException : SystemException
public __gc __sealed class IndexOutOfRangeException : public
class IndexOutOfRangeException extends SystemException

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


The following Microsoft intermediate language (MSIL) instructions throw IndexOutOfRangeException:

  • ldelem.<type>
  • ldelema
  • stelem.<type>

IndexOutOfRangeException uses the HRESULT COR_E_INDEXOUTOFRANGE, which has the value 0x80131508.

For a list of initial property values for an instance of IndexOutOfRangeException, see the IndexOutOfRangeException constructors.


Namespace: System

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

Assembly: Mscorlib (in Mscorlib.dll)

See Also

IndexOutOfRangeException Members | System Namespace | Exception | Handling and Throwing Exceptions

© 2018 Microsoft