Compiler Error C3917
Visual Studio 2015
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 C3917.
property': obsolete construct declaration style
A property or event definition used syntax from a previous version.
If you want to use syntax from a previous version, use /clr:oldSyntax.
For more information, see property.
// C3917.cpp
// compile with: /clr /c
public ref class C {
private:
int m_length;
public:
C() {
m_length = 0;
}
property int get_Length(); // C3917
// The correct property definition:
property int Length {
int get() {
return m_length;
}
void set( int i ) {
m_length = i;
}
}
};
Show: