Click here to Skip to main content
15,885,216 members
Articles / Programming Languages / C#

Alternative to Activator.CreateInstance

Rate me:
Please Sign up or sign in to vote.
1.00/5 (2 votes)
31 Jan 2012CPOL 9.4K  
I've tried a few different ways to dynamically create an object of 'unknown' type.This is my final, simple result: public static T Create() { Type type = typeof(T); return (T)type.Assembly.CreateInstance(type.FullName); ...

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
South Africa South Africa
C# Developer

Comments and Discussions