internal WebApplication( string name, bool supportsSecureConnections, InstallationStandardBaseUrl baseUrl, InstallationStandardCookieAttributes cookieAttributes) { Name = name; SupportsSecureConnections = supportsSecureConnections; // We must pass values for all components since we will not have defaults to fall back on when getting the URL string for this object. DefaultBaseUrl = new BaseUrl( baseUrl.Host, baseUrl.NonsecurePortSpecified ? baseUrl.NonsecurePort : 80, baseUrl.SecurePortSpecified ? baseUrl.SecurePort : 443, baseUrl.Path ?? "" ); DefaultCookieAttributes = cookieAttributes != null ? new DefaultCookieAttributes( cookieAttributes.Domain, cookieAttributes.Path, cookieAttributes.NamePrefix ) : new DefaultCookieAttributes( null, null, null ); }
internal WebApplication( string name, string installationPath, bool supportsSecureConnections, InstallationStandardBaseUrl baseUrl, InstallationStandardCookieAttributes cookieAttributes) { Name = name; Path = EwlStatics.CombinePaths(installationPath, name); SupportsSecureConnections = supportsSecureConnections; // We must pass values for all components since we will not have defaults to fall back on when getting the URL string for this object. DefaultBaseUrl = new BaseUrl( baseUrl.Host, baseUrl.NonsecurePortSpecified ? baseUrl.NonsecurePort : 80, baseUrl.SecurePortSpecified ? baseUrl.SecurePort : 443, baseUrl.Path ?? ""); DefaultCookieAttributes = cookieAttributes != null ? new DefaultCookieAttributes(cookieAttributes.Domain, cookieAttributes.Path, cookieAttributes.NamePrefix) : new DefaultCookieAttributes(null, null, null); }
internal WebApplication( string name, string installationPath, bool supportsSecureConnections, InstallationStandardWebApplication configuration, string installationFullShortName, bool systemHasMultipleWebApplications) { Name = name; Path = EwlStatics.CombinePaths(installationPath, name); SupportsSecureConnections = supportsSecureConnections; IisApplication = configuration.IisApplication; var site = configuration.IisApplication as Site; var siteHostName = site?.HostNames.First(); var virtualDirectory = configuration.IisApplication as VirtualDirectory; if (virtualDirectory != null && virtualDirectory.Name == null) { virtualDirectory.Name = installationFullShortName + (systemHasMultipleWebApplications ? name.EnglishToPascal() : ""); } // We must pass values for all components since we will not have defaults to fall back on when getting the URL string for this object. DefaultBaseUrl = configuration.DefaultBaseUrl != null ? new BaseUrl( configuration.DefaultBaseUrl.Host, configuration.DefaultBaseUrl.NonsecurePortSpecified ? configuration.DefaultBaseUrl.NonsecurePort : 80, configuration.DefaultBaseUrl.SecurePortSpecified ? configuration.DefaultBaseUrl.SecurePort : 443, configuration.DefaultBaseUrl.Path ?? "") : site != null ? new BaseUrl( siteHostName.Name, siteHostName.NonsecurePortSpecified ? siteHostName.NonsecurePort : 80, siteHostName.SecureBinding != null && siteHostName.SecureBinding.PortSpecified ? siteHostName.SecureBinding.Port : 443, "") : new BaseUrl(virtualDirectory.Site, 80, 443, virtualDirectory.Name); DefaultCookieAttributes = configuration.DefaultCookieAttributes != null ? new DefaultCookieAttributes( configuration.DefaultCookieAttributes.Domain, configuration.DefaultCookieAttributes.Path, configuration.DefaultCookieAttributes.NamePrefix) : new DefaultCookieAttributes(null, null, null); }
internal WebApplication( string name, string installationPath, bool supportsSecureConnections, string systemShortName, bool systemHasMultipleWebApplications, WebProject configuration) { Name = name; Path = EwlStatics.CombinePaths( installationPath, name ); SupportsSecureConnections = supportsSecureConnections; var iisExpress = File.ReadAllText( EwlStatics.CombinePaths( Path, name + ".csproj" ) ).Contains( "<UseIISExpress>true</UseIISExpress>" ); // We must pass values for all components since we will not have defaults to fall back on when getting the URL string for this object. DefaultBaseUrl = new BaseUrl( "localhost", iisExpress ? 8080 : 80, iisExpress ? 44300 : 443, systemShortName + ( systemHasMultipleWebApplications ? name.EnglishToPascal() : "" ) ); var cookieAttributes = configuration.DefaultCookieAttributes; DefaultCookieAttributes = cookieAttributes != null ? new DefaultCookieAttributes( null, cookieAttributes.Path, cookieAttributes.NamePrefix ) : new DefaultCookieAttributes( null, null, null ); }
internal WebApplication( string name, string installationPath, bool supportsSecureConnections, string systemShortName, bool systemHasMultipleWebApplications, WebProject configuration) { Name = name; Path = EwlStatics.CombinePaths(installationPath, name); SupportsSecureConnections = supportsSecureConnections; var iisExpress = File.ReadAllText(EwlStatics.CombinePaths(Path, name + ".csproj")).Contains("<UseIISExpress>true</UseIISExpress>"); // We must pass values for all components since we will not have defaults to fall back on when getting the URL string for this object. DefaultBaseUrl = new BaseUrl( "localhost", iisExpress ? 8080 : 80, iisExpress ? 44300 : 443, systemShortName + (systemHasMultipleWebApplications ? name.EnglishToPascal() : "")); var cookieAttributes = configuration.DefaultCookieAttributes; DefaultCookieAttributes = cookieAttributes != null ? new DefaultCookieAttributes(null, cookieAttributes.Path, cookieAttributes.NamePrefix) : new DefaultCookieAttributes(null, null, null); }