private EnvironmentManager()
        {
            // TODO(andre.nogueira): Error checking to guard against malformed config files
            string   driverClassName = GetSettingValue("Driver");
            string   assemblyName    = GetSettingValue("Assembly");
            Assembly assembly        = Assembly.Load(assemblyName);

            driverType = assembly.GetType(driverClassName);

            Assembly executingAssembly = Assembly.GetExecutingAssembly();
            string   assemblyLocation  = executingAssembly.Location;

            // If we're shadow copying,. fiddle with
            // the codebase instead
            if (AppDomain.CurrentDomain.ShadowCopyFiles)
            {
                Uri uri = new Uri(executingAssembly.CodeBase);
                assemblyLocation = uri.LocalPath;
            }

            string        currentDirectory = Path.GetDirectoryName(assemblyLocation);
            DirectoryInfo info             = new DirectoryInfo(currentDirectory);

            while (info != info.Root && string.Compare(info.Name, "build", StringComparison.OrdinalIgnoreCase) != 0)
            {
                info = info.Parent;
            }

            info         = info.Parent;
            remoteServer = new SeleniumServer(info.FullName, true, port);
        }
        private EnvironmentManager()
        {
            // TODO(andre.nogueira): Error checking to guard against malformed config files
            string driverClassName = GetSettingValue("Driver");
            string assemblyName = GetSettingValue("Assembly");
            Assembly assembly = Assembly.Load(assemblyName);
            driverType = assembly.GetType(driverClassName);

            Assembly executingAssembly = Assembly.GetExecutingAssembly();
            string assemblyLocation = executingAssembly.Location;

            // If we're shadow copying,. fiddle with
            // the codebase instead
            if (AppDomain.CurrentDomain.ShadowCopyFiles)
            {
                Uri uri = new Uri(executingAssembly.CodeBase);
                assemblyLocation = uri.LocalPath;
            }

            string currentDirectory = Path.GetDirectoryName(assemblyLocation);
            DirectoryInfo info = new DirectoryInfo(currentDirectory);
            while (info != info.Root && string.Compare(info.Name, "build", StringComparison.OrdinalIgnoreCase) != 0)
            {
                info = info.Parent;
            }

            info = info.Parent;
            remoteServer = new SeleniumServer(info.FullName, true, port);
        }