What is the most efficient way to get the default constructor (i.e. instance constructor with no parameters) of a System.Type?
I was thinking something along the lines o
If you actually need the ConstructorInfo object, then see Curt Hagenlocher's answer.
On the other hand, if you're really just trying to create an object at run-time from a System.Type
, see System.Activator.CreateInstance -- it's not just future-proofed (Activator handles more details than ConstructorInfo.Invoke
), it's also much less ugly.