Exemplo n.º 1
0
        public void CreateHost(ApplicationServer server, WebSource webSource)
        {
            string v = vpath;

            if (v != "/" && v.EndsWith("/"))
            {
                v = v.Substring(0, v.Length - 1);
            }

            AppHost        = ApplicationHost.CreateApplicationHost(webSource.GetApplicationHostType(), v, realPath) as IApplicationHost;
            AppHost.Server = server;

            // Link the host in the application domain with a request broker in the main domain
            RequestBroker         = webSource.CreateRequestBroker();
            AppHost.RequestBroker = RequestBroker;
        }
Exemplo n.º 2
0
        public void CreateHost(ApplicationServer server, WebSource webSource)
        {
            string v = vpath;
            if (v != "/" && v.EndsWith ("/")) {
                v = v.Substring (0, v.Length - 1);
            }

            AppHost = ApplicationHost.CreateApplicationHost (webSource.GetApplicationHostType(), v, realPath) as IApplicationHost;
            AppHost.Server = server;

            if (!server.SingleApplication) {
                // Link the host in the application domain with a request broker in the main domain
                RequestBroker = webSource.CreateRequestBroker ();
                AppHost.RequestBroker = RequestBroker;
            }
        }
Exemplo n.º 3
0
        public void CreateHost(ApplicationServer server, WebSource webSource)
        {
            string v = vpath;

            if (v != "/" && v.EndsWith("/"))
            {
                v = v.Substring(0, v.Length - 1);
            }

            var domain      = AppDomain.CurrentDomain;
            var debugDomain = domain.GetData("DebugDomain") as DebugDomain;
            var listAsm     = domain.GetAssemblies();
            // { Mono.WebServer, Version = 4.4.0.0, Culture = neutral, PublicKeyToken = 0738eb9f132ed756}
            // { Mono.WebServer.XSP, Version = 4.9.0.0, Culture = neutral, PublicKeyToken = 0738eb9f132ed756}

            Exception error = null;

            try
            {
                var hostType = webSource.GetApplicationHostType();
                AppHost =
                    Mono.Web.Hosting.
                    ApplicationHost.CreateApplicationHost(hostType, v, realPath) as IApplicationHost;
                AppHost.Server = server;
            } catch (Exception err) { error = err.InnerException ?? err; }

            if (AppHost == null && error != null)
            {
                Console.WriteLine(error.Message);
                if (Debugger.IsAttached)
                {
                    Debugger.Break();
                }

                Console.ReadKey();
                // throw error;
            }

            if (!server.SingleApplication)
            {
                // Link the host in the application domain with a request broker in the main domain
                RequestBroker         = webSource.CreateRequestBroker();
                AppHost.RequestBroker = RequestBroker;
            }
        }