This documentation is archived and is not being maintained.

Compiler Error CS1529

A using clause must precede all other namespace elements

Statements with a using clause must appear first in a namespace.

The following sample generates CS1529:

// CS1529.cs
namespace x
   namespace subspace
      using Microsoft;

      class SomeClass

      using Microsoft;        // CS1529, place before class definition

   using System.Reflection;   // CS1529, place before namespace 'subspace'

using System;                 // CS1529, place at the beginning of the file