Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

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)
   {
   } 
}
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.