From 49bafecb94784f8477733296fc2da575e93e4115 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Sun, 10 May 2020 03:29:58 -0400 Subject: [PATCH] first try using System.Type own GetType() method before looking deeper --- MBS.Framework/Reflection.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/MBS.Framework/Reflection.cs b/MBS.Framework/Reflection.cs index 0ffe98f..963d7c5 100644 --- a/MBS.Framework/Reflection.cs +++ b/MBS.Framework/Reflection.cs @@ -29,6 +29,11 @@ namespace MBS.Framework private static Dictionary TypesByName = new Dictionary(); public static Type FindType(string TypeName) { + // first try using System.Type own GetType() method + Type type = Type.GetType(TypeName); + if (type != null) return type; + + // if we don't get it from that we look a little deeper through reflection if (!TypesByName.ContainsKey(TypeName)) { Assembly[] asms = GetAvailableAssemblies();