Compiler Error C2696
Cannot create a temporary object of a managed type 'type'
References to const
in an unmanaged program cause the compiler to call the constructor and create a temporary object on the stack. However, a managed class can never be created on the stack.
C2696 is only reachable using the obsolete compiler option /clr:oldSyntax.
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