I have a generic class that should allow any type, primitive or otherwise. The only problem with this is using default(T). When you call default on a value type
default(T)
if (typeof(T).IsValueType || typeof(T) == typeof(String)) { return default(T); } else { return Activator.CreateInstance(); }
Untested, but the first thing that came to mind.