public static IVBinAssemblyResolver Initialise(string[] args) { try { string bootStrapperTypeName = ConfigurationManager.AppSettings["VBinBootStrapperType"]; if (string.IsNullOrWhiteSpace(bootStrapperTypeName)) { throw new ArgumentException("Missing VBinBootStrapperType config value"); } Type bootStrapperType = Type.GetType(bootStrapperTypeName, true); g_bootStrapper = (IVBinBootStrapper)Activator.CreateInstance(bootStrapperType); g_bootStrapper.Initialise(); GetVersionPaths(args); g_bootStrapper.SetVersion(g_version.Value, g_basePath, g_exeName); //Give the bootstrapper the opportunity to resolve assemblies first AppDomain.CurrentDomain.AssemblyResolve += g_bootStrapper.CurrentDomainAssemblyResolve; g_resolver = g_bootStrapper.CreateResolver(g_remainingArgs); return(g_resolver); } catch (Exception ex) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(ex); Console.ResetColor(); } return(null); }
public ConfigManagerCore(IConfigPersistor defaultPersistor) { m_environment = ObjectFactory.GetInstance <IEnvironment>(); m_persistor = defaultPersistor ?? ObjectFactory.GetInstance <IConfigPersistor>(); m_assemblyResolver = VBinManager.Resolver; m_appSettings = new ConfigAppSettings(this); }
public VBinManager() { m_resolver = ObjectFactory.TryGetInstance <IVBinAssemblyResolver>() ?? new SystemAssemblyResolver(); }
public AppDomainCreationHelper(long version) { g_resolver = VBinProgram.Initialise(new string[] { "-v=" + version, "." }); }