Export (0) Print
Expand All
Expand Minimize

Compiler Error CS0116

A namespace does not directly contain members such as fields or methods

Inside a namespace, the compiler only accepts classes, structs, unions, enums, interfaces, and delegates.

The following sample generates CS0116:

// CS0116.cs
namespace x
{
   int xx;   // CS0116
}
Show:
© 2014 Microsoft