コード例 #1
0
        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);
        }
コード例 #2
0
        internal WebApplication(
            string name, bool supportsSecureConnections, string installationPath, string systemShortName, bool systemHasMultipleWebApplications, WebProject configuration)
        {
            Name = name;
            SupportsSecureConnections = supportsSecureConnections;

            var iisExpress =
                File.ReadAllText(StandardLibraryMethods.CombinePaths(installationPath, name, 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);
        }