public static Result Resolve() { Result result = new Result(); try { foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()) { foreach (Type type in assembly.GetTypes()) { CCommand cmd; if ((cmd = ResolveCommand(type)) != null) { result.AddCommand(cmd); } else if (IsCVarContainer(type)) { result.AddContainer(type); } } } } catch (ReflectionTypeLoadException e) { StringBuilder message = new StringBuilder("Unable to resolve Lunar commands:"); foreach (Exception ex in e.LoaderExceptions) { message.AppendFormat("\n\t{0}", ex.Message); } throw new LunarRuntimeResolverException(message.ToString(), e); } catch (Exception e) { throw new LunarRuntimeResolverException("Unable to resolve Lunar commands", e); } return(result); }