internal static IServerConfig GetDefaultDomainInstance(string version)
 {
     if (version == null)
     {
         return GetInstance();
     }
     ExpressServerConfig config = null;
     lock (s_expressConfigsLock)
     {
         if (s_expressConfigs == null)
         {
             if (!Thread.GetDomain().IsDefaultAppDomain())
             {
                 throw new InvalidOperationException();
             }
             s_expressConfigs = new Dictionary<string, ExpressServerConfig>(3);
         }
         if (!s_expressConfigs.TryGetValue(version, out config))
         {
             config = new ExpressServerConfig(version);
             s_expressConfigs[version] = config;
         }
     }
     return config;
 }
        static internal IServerConfig GetDefaultDomainInstance(string version)
        {
            if (version == null)
            {
                return(GetInstance());
            }
            ExpressServerConfig expressConfig = null;

            lock (s_expressConfigsLock) {
                if (s_expressConfigs == null)
                {
                    if (!Thread.GetDomain().IsDefaultAppDomain())
                    {
                        throw new InvalidOperationException();
                    }
                    s_expressConfigs = new Dictionary <string, ExpressServerConfig>(3);
                }
                if (!s_expressConfigs.TryGetValue(version, out expressConfig))
                {
                    expressConfig             = new ExpressServerConfig(version);
                    s_expressConfigs[version] = expressConfig;
                }
            }
            return(expressConfig);
        }
Exemple #3
0
 internal static IServerConfig GetInstance()
 {
     if (UseMetabase)
     {
         return(MetabaseServerConfig.GetInstance());
     }
     if (IISExpressVersion == null)
     {
         return(ProcessHostServerConfig.GetInstance());
     }
     return(ExpressServerConfig.GetInstance(IISExpressVersion));
 }
 // called by HostingEnvironment to initiliaze the singleton config
 // instance for the domain
 static internal IServerConfig GetInstance(string version) {
     if (s_instance == null) {
         lock (s_initLock) {
             if (s_instance == null) {
                 if (Thread.GetDomain().IsDefaultAppDomain()) {
                     throw new InvalidOperationException();
                 }
                 s_instance = new ExpressServerConfig(version);
             }
         }
     }
     return s_instance;
 }
 static internal IServerConfig GetInstance()
 {
     // IIS 7 bits on <= IIS 6: use the metabase
     if (UseMetabase)
     {
         return(MetabaseServerConfig.GetInstance());
     }
     if (IISExpressVersion == null)
     {
         return(ProcessHostServerConfig.GetInstance());
     }
     return(ExpressServerConfig.GetInstance(IISExpressVersion));
 }
 // called by HostingEnvironment to initiliaze the singleton config
 // instance for the domain
 static internal IServerConfig GetInstance(string version)
 {
     if (s_instance == null)
     {
         lock (s_initLock) {
             if (s_instance == null)
             {
                 if (Thread.GetDomain().IsDefaultAppDomain())
                 {
                     throw new InvalidOperationException();
                 }
                 s_instance = new ExpressServerConfig(version);
             }
         }
     }
     return(s_instance);
 }