Compiler Error C3800

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Compiler Error C3800.

declaration': cannot mix properties and events

You cannot declare a construct to be both a property and an event.

C3800 is only reachable using /clr:oldSyntax.

The following sample generates C3800:

// C3800.cpp  
// compile with: /clr:oldSyntax  
#using "mscorlib.dll"  
  
__delegate void MyDel();  
public __gc struct S  
{  
   __property __event void set_E(MyDel*)  
   {  
   }   // C3800  
};  
  
int main()  
{  
}  

Show: