private static bool IsNet45OrNewer() { // Class "ReflectionContext" exists in .NET 4.5 . return Type.GetType("System.Reflection.ReflectionContext", false) != null; }