Compiler Error CS0022
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

Compiler Error CS0022

Wrong number of indices inside [], expected 'number'

An array-access operation specified multiple indices where only one is allowed.

The following sample generates CS0022:

// CS0022.cs
public class MyClass
   public static void Main()
      int[] a = new int[10];
      a[0] = 0;     // single-dimension array
      a[0,1] = 9;   // CS0022
© 2015 Microsoft