Compiler Error C3908
Collapse the table of content
Expand the table of content
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. ArchiveDisclaimer

Compiler Error C3908

Error Message

access level less restrictive than 'construct'

A property accessor method (get or set) cannot have less restrictive access than the access specified on the property itself. Similarly, for event accessor methods.

For more information, see property and event.

The following sample generates C3908:

// C3908.cpp
// compile with: /clr
ref class X {
   property int i {
   public:   // C3908 property i is protected 
      int get();
      void set(int);   // OK more restrictive
© 2015 Microsoft