internal void Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException)
 {
     this._hostingParameters = hostingParameters;
     HostingEnvironmentFlags hostingFlags = HostingEnvironmentFlags.Default;
     if (this._hostingParameters != null)
     {
         hostingFlags = this._hostingParameters.HostingFlags;
         if (this._hostingParameters.IISExpressVersion != null)
         {
             ServerConfig.IISExpressVersion = this._hostingParameters.IISExpressVersion;
         }
     }
     if ((hostingFlags & HostingEnvironmentFlags.HideFromAppManager) == HostingEnvironmentFlags.Default)
     {
         this._appManager = appManager;
     }
     if ((hostingFlags & HostingEnvironmentFlags.ClientBuildManager) != HostingEnvironmentFlags.Default)
     {
         BuildManagerHost.InClientBuildManager = true;
     }
     if ((hostingFlags & HostingEnvironmentFlags.SupportsMultiTargeting) != HostingEnvironmentFlags.Default)
     {
         BuildManagerHost.SupportsMultiTargeting = true;
     }
     if ((appHost is ISAPIApplicationHost) && !ServerConfig.UseMetabase)
     {
         string str = ((ISAPIApplicationHost) appHost).ResolveRootWebConfigPath();
         if (!string.IsNullOrEmpty(str))
         {
             HttpConfigurationSystem.RootWebConfigurationFilePath = str;
         }
         IProcessHostSupportFunctions supportFunctions = ((ISAPIApplicationHost) appHost).SupportFunctions;
         if (supportFunctions != null)
         {
             _functions = Misc.CreateLocalSupportFunctions(supportFunctions);
         }
     }
     this._appId = HttpRuntime.AppDomainAppIdInternal;
     this._appVirtualPath = HttpRuntime.AppDomainAppVirtualPathObject;
     this._appPhysicalPath = HttpRuntime.AppDomainAppPathInternal;
     this._appHost = appHost;
     this._configMapPath = configMapPathFactory.Create(this._appVirtualPath.VirtualPathString, this._appPhysicalPath);
     HttpConfigurationSystem.EnsureInit(this._configMapPath, true, false);
     this._configMapPath2 = this._configMapPath as IConfigMapPath2;
     this._initiateShutdownWorkItemCallback = new WaitCallback(this.InitiateShutdownWorkItemCallback);
     if (this._appManager != null)
     {
         this._appManager.HostingEnvironmentActivated(CacheMemorySizePressure.EffectiveProcessMemoryLimit);
     }
     if (this._appHost == null)
     {
         this._appHost = new SimpleApplicationHost(this._appVirtualPath, this._appPhysicalPath);
     }
     else
     {
         this._externalAppHost = true;
     }
     this._configToken = this._appHost.GetConfigToken();
     this._mapPathBasedVirtualPathProvider = new MapPathBasedVirtualPathProvider();
     this._virtualPathProvider = this._mapPathBasedVirtualPathProvider;
     HttpRuntime.InitializeHostingFeatures(hostingFlags, policyLevel, appDomainCreationException);
     if (!BuildManagerHost.InClientBuildManager)
     {
         this.StartMonitoringForIdleTimeout();
     }
     this.EnforceAppDomainLimit();
     this.GetApplicationIdentity();
     if (!HttpRuntime.HostingInitFailed)
     {
         try
         {
             BuildManager.CallPreStartInitMethods();
             if ((hostingFlags & HostingEnvironmentFlags.DontCallAppInitialize) == HostingEnvironmentFlags.Default)
             {
                 BuildManager.CallAppInitializeMethod();
             }
         }
         catch (Exception exception)
         {
             HttpRuntime.InitializationException = exception;
             if ((hostingFlags & HostingEnvironmentFlags.ThrowHostingInitErrors) != HostingEnvironmentFlags.Default)
             {
                 throw;
             }
         }
     }
 }
Beispiel #2
0
 public RouteCollection(System.Web.Hosting.VirtualPathProvider virtualPathProvider)
 {
 }
 /// <summary>
 /// Configura o template.
 /// </summary>
 /// <param name="pathProvider"></param>
 public void Configure(System.Web.Hosting.VirtualPathProvider pathProvider)
 {
     _pathProvider = pathProvider;
 }