Adding the following catch shows everything:
catch (Exception e) { var t = e.GetType(); while (t != null) { Console.WriteLine(t.AssemblyQualifiedName); t = t.BaseType; } }
Output:
System.Xml.Xsl.XslTransformException, System.Data.SqlXml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Xml.Xsl.XsltException, System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.SystemException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Exception, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
I would ignore the XslTransformException , though - you should catch an XsltException . In the end, this is what XslCompiledTransform.Transform documented for throwing.
source share