// Class library written in C++/CLI. var myClass = new ThrowNonCLS.Class1(); try { // throws gcnew System::String( // "I do not derive from System.Exception!"); myClass.TestThrow(); } catch (RuntimeWrappedException e) { String s = e.WrappedException as String; if (s != null) { Console.WriteLine(s); } }