Compiler Error CS0201
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 CS0201

Only assignment, call, increment, decrement, and new object expressions can be used as a statement

The compiler generates an error when it encounters a meaningless statement.

The following sample generates CS0201:

// CS0201.cs
using System;

public class MainClass
   public static void Main ()
      2 * 3;   // CS0201
© 2015 Microsoft