예제 #1
0
        internal WebServerIISExpress(WebServerSettings settings,
                                     IFileSystem fileSystem,
                                     IEnvironmentSystem environmentSystem,
                                     IProcessRunner processRunner)
        {
            this._architecture      = settings.Architecture;
            this._fileSystem        = fileSystem;
            this._environmentSystem = environmentSystem;
            this._processRunner     = processRunner;

            this._hostName         = settings.HostName;
            this._startupTimeout   = settings.StartupTimeout;
            this._rootPhysicalPath = string.IsNullOrEmpty(settings.RootPhysicalPath)
                ? Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)
                : settings.RootPhysicalPath;
            this._httpPort             = this._environmentSystem.GetNextAvailablePort();
            this._serverExecutablePath = LocateIISExpress();

            this._applicationHostConfigPath = CreateApplicationHostConfigFromTemplate();
            this._serverManager             = new ServerManager(_applicationHostConfigPath);

            InitializeApplicationHostConfig();

            Start();
        }
예제 #2
0
        internal WebServerIIS(WebServerSettings settings, IFileSystem fileSystem, IEnvironmentSystem environmentSystem)
        {
            this._environmentSystem = environmentSystem;
            this._fileSystem        = fileSystem;

            this._hostName         = settings.HostName;
            this._rootPhysicalPath = string.IsNullOrEmpty(settings.RootPhysicalPath)
                ? this._environmentSystem.ExpandEnvironmentVariables(@"%SystemDrive%\inetpub\wwwroot")
                : settings.RootPhysicalPath;

            this._version = GetIISVersion();

            this._serverManager = new ServerManager();
        }
예제 #3
0
        public static WebServer Create(WebServerType type, WebServerSettings settings)
        {
            WebServer server = null;

            if (type == WebServerType.IIS)
            {
                server = new WebServerIIS(settings);
            }
            else
            {
                server = new WebServerIISExpress(settings);
            }

            return(server);
        }
예제 #4
0
 public WebServerIISExpress(WebServerSettings settings)
     : this(settings, Dependencies.FileSystem, Dependencies.EnvironmentSystem, Dependencies.ProcessRunner)
 {
 }
예제 #5
0
 public WebServerIIS(WebServerSettings settings)
     : this(settings, Dependencies.FileSystem, Dependencies.EnvironmentSystem)
 {
 }