Compiler Error C2811
'type1' : cannot inherit from 'type2', a ref class can only inherit from a ref class or interface class
You attempted to use an unmanaged class as a base class for a managed class.
The following sample generates C2811:
// C2811.cpp
// compile with: /clr /c
struct S{};
ref struct T {};
ref class C : public S {}; // C2811
ref class D : public T {}; // OK
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for