Example #1
0
        static HttpRuntime()
        {
#if !TARGET_J2EE
            firstRun = true;

            try {
                WebConfigurationManager.Init();
#if MONOWEB_DEP
                SettingsMappingManager.Init();
#endif
                runtime_section = (HttpRuntimeSection)WebConfigurationManager.GetSection("system.web/httpRuntime");
            } catch (Exception ex) {
                initialException = ex;
            }

            // The classes in whose constructors exceptions may be thrown, should be handled the same way QueueManager
            // and TraceManager are below. The constructors themselves MUST NOT throw any exceptions - we MUST be sure
            // the objects are created here. The exceptions will be dealt with below, in RealProcessRequest.
            queue_manager = new QueueManager();
            if (queue_manager.HasException)
            {
                if (initialException == null)
                {
                    initialException = queue_manager.InitialException;
                }
                else
                {
                    Console.Error.WriteLine("Exception during QueueManager initialization:");
                    Console.Error.WriteLine(queue_manager.InitialException);
                }
            }

            trace_manager = new TraceManager();
            if (trace_manager.HasException)
            {
                if (initialException == null)
                {
                    initialException = trace_manager.InitialException;
                }
                else
                {
                    Console.Error.WriteLine("Exception during TraceManager initialization:");
                    Console.Error.WriteLine(trace_manager.InitialException);
                }
            }

            registeredAssemblies = new SplitOrderedList <string, string> (StringComparer.Ordinal);
            cache         = new Cache();
            internalCache = new Cache();
            internalCache.DependencyCache = internalCache;
#endif
            do_RealProcessRequest = new WaitCallback(state => {
                try {
                    RealProcessRequest(state);
                } catch {}
            });
            end_of_send_cb = new HttpWorkerRequest.EndOfSendNotification(EndOfSend);
        }
Example #2
0
 public HttpRuntime()
 {
     WebConfigurationManager.Init();
     _queue_manager = new QueueManager();
     _trace_manager = new TraceManager();
     _cache         = new Cache();
     _internalCache = new Cache();
     _internalCache.DependencyCache = _cache;
 }
Example #3
0
        static HttpRuntime()
        {
            PlatformID pid = Environment.OSVersion.Platform;

            runningOnWindows = ((int)pid != 128
#if NET_2_0
                                && pid != PlatformID.Unix && pid != PlatformID.MacOSX
#endif
                                );

            if (runningOnWindows)
            {
                caseInsensitive = true;
                if (AppDomainAppPath != null)
                {
                    isunc = new Uri(AppDomainAppPath).IsUnc;
                }
            }
            else
            {
                string mono_iomap = Environment.GetEnvironmentVariable("MONO_IOMAP");
                if (mono_iomap != null)
                {
                    if (mono_iomap == "all")
                    {
                        caseInsensitive = true;
                    }
                    else
                    {
                        string[] parts = mono_iomap.Split(':');
                        foreach (string p in parts)
                        {
                            if (p == "all" || p == "case")
                            {
                                caseInsensitive = true;
                                break;
                            }
                        }
                    }
                }
            }

            Type monoRuntime = Type.GetType("Mono.Runtime", false);
            monoVersion = null;
            if (monoRuntime != null)
            {
                MethodInfo mi = monoRuntime.GetMethod("GetDisplayName", BindingFlags.Static | BindingFlags.NonPublic);
                if (mi != null)
                {
                    monoVersion = mi.Invoke(null, new object [0]) as string;
                }
            }

            if (monoVersion == null)
            {
                monoVersion = Environment.Version.ToString();
            }

#if !TARGET_J2EE
            firstRun = true;
#if NET_2_0
            try {
                WebConfigurationManager.Init();
#if MONOWEB_DEP
                SettingsMappingManager.Init();
#endif
            } catch (Exception ex) {
                initialException = ex;
            }
#endif

            // The classes in whose constructors exceptions may be thrown, should be handled the same way QueueManager
            // and TraceManager are below. The constructors themselves MUST NOT throw any exceptions - we MUST be sure
            // the objects are created here. The exceptions will be dealt with below, in RealProcessRequest.
            queue_manager = new QueueManager();
            if (queue_manager.HasException)
            {
                initialException = queue_manager.InitialException;
            }

            trace_manager = new TraceManager();
            if (trace_manager.HasException)
            {
                initialException = trace_manager.InitialException;
            }

            cache         = new Cache();
            internalCache = new Cache();
            internalCache.DependencyCache = cache;
#endif
            do_RealProcessRequest = new WaitCallback(RealProcessRequest);
            end_of_send_cb        = new HttpWorkerRequest.EndOfSendNotification(EndOfSend);
        }