ctor.Invoke vs Activator

Mar 25, 2008 at 3:11 AM
Edited Mar 25, 2008 at 3:11 AM
Out of curiosity:

In UnityContainerExtensionElement.Configure(...)

There's something like

ConstructorInfo ctor = Type.GetConstructor(Type.EmptyTypes);
UnityContainerExtension instance = (UnityContainerExtension)ctor.Invoke(null);

And I was wondering (for my own mental sanity) if there are any pros to this approach as opposed to using:

UnityContainerExtension instance = (UnityContainerExtension)Activator.CreateInstance(Type);
Mar 25, 2008 at 4:29 AM
Probably not. It's just where I ended up.