'element' : 'attribute' can only be applied to a class, interface, array or pointer
The managed attribute can only be used on a class, interface, or array.
The following sample generates C3150:
#using <mscorlib.dll> __gc void f() { // C3150; function cannot be managed } void main() { }