Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Compiler Error C2725
Collapse the table of content
Expand the table of content

Compiler Error C2725

'exception' : unable to throw or catch a __gc type object by value or reference

The type of a managed exception was not correct.

The following sample generates C2725:

// C2725.cpp
// compile with: /clr
#using <mscorlib.dll>
using namespace System;
int main()
{
   try
   {
   }
   catch( System::Exception&)   // C2725
   // try the following line instead
   // catch( System::Exception *e)
   {
   } 
}
Show:
© 2015 Microsoft