Addresses dotnet/aspnetcore#322 

Commit migrated from dotnet/aspnetcore@cb7942abe4
This commit is contained in:
Jass Bagga 2018-03-29 13:59:47 -07:00 коммит произвёл GitHub
Родитель f85e9ca96f
Коммит 95fa23da3c
18 изменённых файлов: 76 добавлений и 9 удалений

Просмотреть файл

@ -19,7 +19,7 @@
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' != ''">
<PackageReference Include="Microsoft.AspNetCore" Version="${MicrosoftAspNetCorePackageVersion}" />
<PackageReference Include="Microsoft.AspNetCore.HttpsPolicy" Version="${MicrosoftAspNetCoreHttpsPolicyPackageVersion}" />
<PackageReference Include="Microsoft.AspNetCore.HttpsPolicy" Version="${MicrosoftAspNetCoreHttpsPolicyPackageVersion}" Condition="'$(NoHttps)' != 'True'"/>
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="${MicrosoftAspNetCoreMvcPackageVersion}" />
<PackageReference Include="Microsoft.AspNetCore.SpaServices" Version="${MicrosoftAspNetCoreSpaServicesPackageVersion}" />
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="${MicrosoftAspNetCoreSpaServicesExtensionsPackageVersion}" />

Просмотреть файл

@ -16,7 +16,7 @@
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' != ''">
<PackageReference Include="Microsoft.AspNetCore" Version="${MicrosoftAspNetCorePackageVersion}" />
<PackageReference Include="Microsoft.AspNetCore.HttpsPolicy" Version="${MicrosoftAspNetCoreHttpsPolicyPackageVersion}" />
<PackageReference Include="Microsoft.AspNetCore.HttpsPolicy" Version="${MicrosoftAspNetCoreHttpsPolicyPackageVersion}" Condition="'$(NoHttps)' != 'True'"/>
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="${MicrosoftAspNetCoreMvcPackageVersion}" />
<PackageReference Include="Microsoft.AspNetCore.SpaServices" Version="${MicrosoftAspNetCoreSpaServicesPackageVersion}" />
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="${MicrosoftAspNetCoreSpaServicesExtensionsPackageVersion}" />

Просмотреть файл

@ -16,7 +16,7 @@
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' != ''">
<PackageReference Include="Microsoft.AspNetCore" Version="${MicrosoftAspNetCorePackageVersion}" />
<PackageReference Include="Microsoft.AspNetCore.HttpsPolicy" Version="${MicrosoftAspNetCoreHttpsPolicyPackageVersion}" />
<PackageReference Include="Microsoft.AspNetCore.HttpsPolicy" Version="${MicrosoftAspNetCoreHttpsPolicyPackageVersion}" Condition="'$(NoHttps)' != 'True'"/>
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="${MicrosoftAspNetCoreMvcPackageVersion}" />
<PackageReference Include="Microsoft.AspNetCore.SpaServices" Version="${MicrosoftAspNetCoreSpaServicesPackageVersion}" />
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="${MicrosoftAspNetCoreSpaServicesExtensionsPackageVersion}" />

Просмотреть файл

@ -22,6 +22,10 @@
"ExcludeLaunchSettings": {
"longName": "exclude-launch-settings",
"shortName": ""
},
"NoHttps": {
"longName": "no-https",
"shortName": ""
}
}
}

Просмотреть файл

@ -67,7 +67,7 @@
"HttpsPort": {
"type": "parameter",
"datatype": "integer",
"description": "Port number to use for the HTTPS endpoint in launchSettings.json."
"description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used)."
},
"HttpsPortGenerated": {
"type": "generated",
@ -115,6 +115,12 @@
"datatype": "bool",
"description": "If specified, skips the automatic restore of the project on create.",
"defaultValue": "false"
},
"NoHttps": {
"type": "parameter",
"datatype": "bool",
"defaultValue": "false",
"description": "Whether to turn off HTTPS. This option only applies if IndividualAuth or OrganizationalAuth are not being used."
}
},
"tags": {

Просмотреть файл

@ -27,5 +27,6 @@
}
],
"excludeLaunchSettings": false,
"minFullFrameworkVersion": "4.6.1"
"minFullFrameworkVersion": "4.6.1",
"disableHttpsSymbol": "NoHttps"
}

Просмотреть файл

@ -18,7 +18,11 @@
"Company.WebApplication1": {
"commandName": "Project",
"launchBrowser": true,
//#if(NoHttps)
"applicationUrl": "http://localhost:5000",
//#else
"applicationUrl": "https://localhost:5001;http://localhost:5000",
//#endif
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}

Просмотреть файл

@ -1,5 +1,8 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
#if (!NoHttps)
using Microsoft.AspNetCore.HttpsPolicy;
#endif
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SpaServices.AngularCli;
using Microsoft.Extensions.Configuration;
@ -38,10 +41,15 @@ namespace Company.WebApplication1
else
{
app.UseExceptionHandler("/Home/Error");
#if (!NoHttps)
app.UseHsts();
}
app.UseHttpsRedirection();
#else
}
#endif
app.UseStaticFiles();
app.UseSpaStaticFiles();

Просмотреть файл

@ -22,6 +22,10 @@
"ExcludeLaunchSettings": {
"longName": "exclude-launch-settings",
"shortName": ""
},
"NoHttps": {
"longName": "no-https",
"shortName": ""
}
}
}

Просмотреть файл

@ -67,7 +67,7 @@
"HttpsPort": {
"type": "parameter",
"datatype": "integer",
"description": "Port number to use for the HTTPS endpoint in launchSettings.json."
"description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used)."
},
"HttpsPortGenerated": {
"type": "generated",
@ -115,6 +115,12 @@
"datatype": "bool",
"description": "If specified, skips the automatic restore of the project on create.",
"defaultValue": "false"
},
"NoHttps": {
"type": "parameter",
"datatype": "bool",
"defaultValue": "false",
"description": "Whether to turn off HTTPS. This option only applies if IndividualAuth or OrganizationalAuth are not being used."
}
},
"tags": {

Просмотреть файл

@ -27,5 +27,6 @@
}
],
"excludeLaunchSettings": false,
"minFullFrameworkVersion": "4.6.1"
"minFullFrameworkVersion": "4.6.1",
"disableHttpsSymbol": "NoHttps"
}

Просмотреть файл

@ -18,7 +18,11 @@
"Company.WebApplication1": {
"commandName": "Project",
"launchBrowser": true,
//#if(NoHttps)
"applicationUrl": "http://localhost:5000",
//#else
"applicationUrl": "https://localhost:5001;http://localhost:5000",
//#endif
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}

Просмотреть файл

@ -1,6 +1,8 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
#if (!NoHttps)
using Microsoft.AspNetCore.HttpsPolicy;
#endif
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SpaServices.ReactDevelopmentServer;
using Microsoft.Extensions.Configuration;
@ -39,10 +41,15 @@ namespace Company.WebApplication1
else
{
app.UseExceptionHandler("/Home/Error");
#if (!NoHttps)
app.UseHsts();
}
app.UseHttpsRedirection();
#else
}
#endif
app.UseStaticFiles();
app.UseSpaStaticFiles();

Просмотреть файл

@ -22,6 +22,10 @@
"skipRestore": {
"longName": "no-restore",
"shortName": ""
},
"NoHttps": {
"longName": "no-https",
"shortName": ""
}
}
}

Просмотреть файл

@ -67,7 +67,7 @@
"HttpsPort": {
"type": "parameter",
"datatype": "integer",
"description": "Port number to use for the HTTPS endpoint in launchSettings.json."
"description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used)."
},
"HttpsPortGenerated": {
"type": "generated",
@ -115,6 +115,12 @@
"datatype": "bool",
"description": "If specified, skips the automatic restore of the project on create.",
"defaultValue": "false"
},
"NoHttps": {
"type": "parameter",
"datatype": "bool",
"defaultValue": "false",
"description": "Whether to turn off HTTPS. This option only applies if IndividualAuth or OrganizationalAuth are not being used."
}
},
"tags": {

Просмотреть файл

@ -27,5 +27,6 @@
}
],
"excludeLaunchSettings": false,
"minFullFrameworkVersion": "4.6.1"
"minFullFrameworkVersion": "4.6.1",
"disableHttpsSymbol": "NoHttps"
}

Просмотреть файл

@ -18,7 +18,11 @@
"Company.WebApplication1": {
"commandName": "Project",
"launchBrowser": true,
//#if(NoHttps)
"applicationUrl": "http://localhost:5000",
//#else
"applicationUrl": "https://localhost:5001;http://localhost:5000",
//#endif
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}

Просмотреть файл

@ -1,6 +1,8 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
#if (!NoHttps)
using Microsoft.AspNetCore.HttpsPolicy;
#endif
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SpaServices.ReactDevelopmentServer;
using Microsoft.Extensions.Configuration;
@ -39,10 +41,15 @@ namespace Company.WebApplication1
else
{
app.UseExceptionHandler("/Home/Error");
#if (!NoHttps)
app.UseHsts();
}
app.UseHttpsRedirection();
#else
}
#endif
app.UseStaticFiles();
app.UseSpaStaticFiles();