Yes, that's indeed a problem in VS2012 and up. Some of the syntax that's specific to C++/CLI got adopted in the new C++11 language specification. Examples are override
, nullptr
and enum class
. The compiler can no longer tell the difference between a managed enum and a native enum and, unfortunately, defaults to the native flavor even though /clr is in effect.
The workaround is described in this feedback article, add the access specifier to force a mismatch with valid native syntax:
private enum class DataCommands
{
Read,
Write
};