diff --git a/NewLife.Core/Common/Utility.cs b/NewLife.Core/Common/Utility.cs
index 2c7f5e6..c2fb2dc 100644
--- a/NewLife.Core/Common/Utility.cs
+++ b/NewLife.Core/Common/Utility.cs
@@ -394,6 +394,9 @@ namespace System
if (ex is TargetInvocationException)
return GetTrue((ex as TargetInvocationException).InnerException);
+ if (ex is TypeInitializationException)
+ return GetTrue((ex as TypeInitializationException).InnerException);
+
return ex;
}
}
diff --git a/NewLife.Core/Reflection/IReflect.cs b/NewLife.Core/Reflection/IReflect.cs
index d9e7140..c7a31d5 100644
--- a/NewLife.Core/Reflection/IReflect.cs
+++ b/NewLife.Core/Reflection/IReflect.cs
@@ -414,7 +414,7 @@ namespace NewLife.Reflection
catch (Exception ex)
{
//throw new Exception("创建对象失败 type={0} parameters={1}".F(type.FullName, parameters.Join()), ex);
- throw new Exception("创建对象失败 type={0} parameters={1} {2}".F(type.FullName, parameters.Join(), ex.GetTrue()?.Message));
+ throw new Exception("创建对象失败 type={0} parameters={1} {2}".F(type.FullName, parameters.Join(), ex.GetTrue()?.Message), ex);
}
}