Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Compiler Error C3813

a property declaration can only appear within the definition of a managed type

A property can only be declared within a user-defined type.

The following sample generates C3813:

// C3813a.cpp
// compile with: /clr
class A
{
   property int Int; // C3813
};

int main()
{
}

The following sample generates C3813:

// C3813b.cpp
// compile with: /clr:oldSyntax
#using <mscorlib.dll>
class A
{
   __property int get_Int()   // C3813
   {
   return 10;
   };
};

int main()
{
}

Community Additions

ADD
Show:
© 2015 Microsoft