Configure() public method

public Configure ( Server server, int port, string virtualPath, string physicalPath ) : void
server Server
port int
virtualPath string
physicalPath string
return void
Esempio n. 1
0
        Host GetHost()
        {
            if (_shutdownInProgress)
            {
                return(null);
            }

            Host host = _host;

            if (host == null)
            {
                lock (this)
                {
                    host = _host;
                    if (host == null)
                    {
                        host = (Host)CreateWorkerAppDomainWithHost(_virtualPath, _physicalPath, typeof(Host));
                        host.Configure(this, _port, _virtualPath, _physicalPath);
                        _host = host;
                    }
                }
            }

            return(host);
        }
Esempio n. 2
0
        private Host GetHost()
        {
            if (_shutdownInProgress)
            {
                return(null);
            }

            Host host = _host;

            if (host == null)
            {
                lock (this) {
                    host = _host;
                    if (host == null)
                    {
                        // Put together some unique app id based on the virtual and physical paths
                        string uniqueAppString = String.Concat(_virtualPath, _physicalPath).ToLowerInvariant();
                        string appId           = (uniqueAppString.GetHashCode()).ToString("x", CultureInfo.InvariantCulture);
                        _host = (Host)_appManager.CreateObject(appId, typeof(Host), _virtualPath, _physicalPath, false /*failIfExists*/);
                        _host.Configure(this, _port, _virtualPath, _physicalPath);
                        host = _host;
                    }
                }
            }

            return(host);
        }
Esempio n. 3
0
        private Host GetHost()
        {
            if (_shutdownInProgress)
            {
                return(null);
            }

            Host host = _host;

            if (host == null)
            {
                lock (this) {
                    host = _host;
                    if (host == null)
                    {
                        // Put together some unique app id based on the virtual and physical paths
                        string            uniqueAppString      = String.Concat(_virtualPath, _physicalPath).ToLowerInvariant();
                        string            appId                = (uniqueAppString.GetHashCode()).ToString("x", CultureInfo.InvariantCulture);
                        Type              buildManagerHostType = typeof(HttpRuntime).Assembly.GetType("System.Web.Compilation.BuildManagerHost");
                        Type              hostType             = typeof(Host);
                        IRegisteredObject buildManagerHost     = _appManager.CreateObject(appId, buildManagerHostType, _virtualPath, _physicalPath, false);
                        buildManagerHostType.InvokeMember(
                            "RegisterAssembly",
                            System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.InvokeMethod | System.Reflection.BindingFlags.NonPublic,
                            null,
                            buildManagerHost,
                            new object[2] {
                            hostType.Assembly.FullName, hostType.Assembly.Location
                        });
                        _host = (Host)_appManager.CreateObject(appId, hostType, _virtualPath, _physicalPath, false /*failIfExists*/);
                        _host.Configure(this, _port, _virtualPath, _physicalPath);
                        host = _host;
                    }
                }
            }

            return(host);
        }
Esempio n. 4
0
 private void CreateHost()
 {
     _host = (Host)ApplicationHost.CreateApplicationHost(typeof(Host), _virtualPath, _physicalPath);
     _host.Configure(this, _port, _virtualPath, _physicalPath, _installPath);
 }
Esempio n. 5
0
        private Host GetHost()
        {
            if (_shutdownInProgress)
                return null;

            Host host = _host;

            if (host == null) {
                lock (this) {
                    host = _host;
                    if (host == null) {
                        // Put together some unique app id based on the virtual and physical paths
                        string uniqueAppString = String.Concat(_virtualPath, _physicalPath).ToLowerInvariant();
                        string appId = (uniqueAppString.GetHashCode()).ToString("x", CultureInfo.InvariantCulture);
                        _host = (Host)_appManager.CreateObject(appId, typeof(Host), _virtualPath, _physicalPath, false /*failIfExists*/);
                        _host.Configure(this, _port, _virtualPath, _physicalPath);
                        host = _host;
                    }
                }
            }

            return host;
        }
Esempio n. 6
0
 private void CreateHost()
 {
     _host = (Host)ApplicationHost.CreateApplicationHost(typeof(Host), _virtualPath, _physicalPath);
     _host.Configure(this, _port, _virtualPath, _physicalPath, _installPath);
 }