static object CreateComponent(Type type) { try { return Activator.CreateInstance(type); } catch (TargetInvocationException e) { throw e.InnerException; } } }