It depends on how you, of course, define "built-in" types.
You might need something like:
public static IEnumerable<Type> GetBuiltInTypes() { return typeof(int).Assembly .GetTypes() .Where(t => t.IsPrimitive); }
This should give you (from MSDN ):
Boolean, Byte, SByte, Int16, UInt16, Int32, UInt32, Int64, UInt64, IntPtr, UIntPtr, Char, Double and Single.
If you have a different definition, you may need to list all types in common BCL assemblies (e.g. mscorlib, System.dll, System.Core.dll, etc.), applying your filter as you go.
Ani
source share