'class' : a nested class cannot have an assembly access specifier as part of its declaration
When applied to a managed type, such as class or struct, the public and private keywords indicate whether the class will be exposed via assembly metadata. public or private cannot be applied to a nested class, which will inherit the assembly access of the enclosing class.
When used with /com+, the following keywords indicate that a class is managed:
The following sample generates C3379:
#using <mscorlib.dll> public __gc class A { public: static int i = 9; public __gc class BA { // C3379. Remove public keyword. public: static int ii = 8; }; }; void main() { A *myA = new A; Console::WriteLine(myA->i); A::BA *myBA = new A::BA; Console::WriteLine(myBA->ii); }