This documentation is archived and is not being maintained.

Compiler Error C2714

'function' : function with inline assembly or '_setjmp' is not allowed to have managed EH constructs

.NET exception handling is not allowed in a function that also contains certain constructs, such as an __asm block.

The following sample generates C2714:

// C2714.cpp
// compile with: /clr
#using <mscorlib.dll>

int nakedfunc(void)
   try {
      __asm {
         mov eax, 10h
   } __finally {
}   // C2714

int main()