Example #1
0
        public override Type FindType(string typeName, string assemblyName)
        {
            var      binPath         = AssemblyUtils.GetAssemblyBinPath(Assembly.GetExecutingAssembly());
            Assembly assembly        = null;
            var      assemblyDllPath = binPath + $"{assemblyName}.dll";

            if (File.Exists(assemblyDllPath))
            {
                assembly = AssemblyUtils.LoadAssembly(assemblyDllPath);
            }
            var assemblyExePath = binPath + $"{assemblyName}.exe";

            if (File.Exists(assemblyExePath))
            {
                assembly = AssemblyUtils.LoadAssembly(assemblyExePath);
            }
            return(assembly != null?assembly.GetType(typeName) : null);
        }