cannot apply sizeof to managed class, interface or value type 'class'
The sizeof operator gets the value of an object at compile time. The size of a managed class, interface, or value type is dynamic and so cannot be known at compile time.
The following sample generates C2847:
#using <mscorlib.dll> __gc class A { }; void main() { A *xA = new A; sizeof(xA); // cannot use sizeof on managed object }