diff --git a/AspNetCore.sln b/AspNetCore.sln index 02b6e7c51c77..f24a0098abb6 100644 --- a/AspNetCore.sln +++ b/AspNetCore.sln @@ -1718,6 +1718,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MinimalJwtBearerSample", "s EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-user-jwts.Tests", "src\Tools\dotnet-user-jwts\test\dotnet-user-jwts.Tests.csproj", "{89896261-C5DD-4901-BCA7-7A5F718BC008}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TestInfrastructure", "TestInfrastructure", "{F0FBA346-D8BC-4FAE-A4B2-85B33FA23055}" + ProjectSection(SolutionItems) = preProject + src\ProjectTemplates\TestInfrastructure\Directory.Build.props.in = src\ProjectTemplates\TestInfrastructure\Directory.Build.props.in + src\ProjectTemplates\TestInfrastructure\Directory.Build.targets.in = src\ProjectTemplates\TestInfrastructure\Directory.Build.targets.in + src\ProjectTemplates\TestInfrastructure\PrepareForTest.targets = src\ProjectTemplates\TestInfrastructure\PrepareForTest.targets + src\ProjectTemplates\TestInfrastructure\runtimeconfig.norollforward.json = src\ProjectTemplates\TestInfrastructure\runtimeconfig.norollforward.json + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -11154,6 +11162,7 @@ Global {AB4B9E75-719C-4589-B852-20FBFD727730} = {0B200A66-B809-4ED3-A790-CB1C2E80975E} {7F079E92-32D5-4257-B95B-CFFB0D49C160} = {7FD32066-C831-4E29-978C-9A2215E85C67} {89896261-C5DD-4901-BCA7-7A5F718BC008} = {AB4B9E75-719C-4589-B852-20FBFD727730} + {F0FBA346-D8BC-4FAE-A4B2-85B33FA23055} = {08D53E58-4AAE-40C4-8497-63EC8664F304} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {3E8720B3-DBDD-498C-B383-2CC32A054E8F} diff --git a/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets b/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets index 70c0c0d8e5a1..fee2679a215b 100644 --- a/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets +++ b/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets @@ -2,7 +2,7 @@ <_Parameter1>DotNetEfFullPath - <_Parameter2>$([MSBuild]::EnsureTrailingSlash('$(NuGetPackageRoot)'))dotnet-ef/$(DotnetEfVersion)/tools/netcoreapp3.1/any/dotnet-ef.dll + <_Parameter2>$([MSBuild]::EnsureTrailingSlash('$(NuGetPackageRoot)'))dotnet-ef/$(DotnetEfVersion)/tools/net6.0/any/dotnet-ef.dll <_Parameter1>TestPackageRestorePath diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/.template.config/localize/templatestrings.en.json b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/.template.config/localize/templatestrings.en.json index 24cfab2ca658..4248d9a49bd8 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/.template.config/localize/templatestrings.en.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/.template.config/localize/templatestrings.en.json @@ -23,10 +23,10 @@ "symbols/UserSecretsId/description": "The ID to use for secrets (use with OrgReadAccess or Individual auth).", "symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.", "symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.", - "symbols/kestrelHttpsPort/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).", + "symbols/kestrelHttpsPort/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 IndividualB2C or OrganizationalAuth is used).", "symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.", - "symbols/iisHttpsPort/description": "Port number to use for the IIS Express 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).", - "symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.", + "symbols/iisHttpsPort/description": "Port number to use for the IIS Express 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 IndividualB2C or OrganizationalAuth is used).", + "symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.", "symbols/UseLocalDB/description": "Whether to use LocalDB instead of SQLite. This option only applies if --auth Individual or --auth IndividualB2C is specified.", "symbols/Framework/description": "The target framework for the project.", "symbols/Framework/choices/net7.0/description": "Target net7.0", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/.template.config/template.json index 0189a641b720..e6437654ecb7 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/.template.config/template.json @@ -341,7 +341,7 @@ "kestrelHttpsPort": { "type": "parameter", "datatype": "integer", - "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)." + "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 IndividualB2C or OrganizationalAuth is used)." }, "kestrelHttpsPortGenerated": { "type": "generated", @@ -381,7 +381,7 @@ "iisHttpsPort": { "type": "parameter", "datatype": "integer", - "description": "Port number to use for the IIS Express 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)." + "description": "Port number to use for the IIS Express 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 IndividualB2C or OrganizationalAuth is used)." }, "iisHttpsPortGenerated": { "type": "generated", @@ -434,13 +434,13 @@ }, "RequiresHttps": { "type": "computed", - "value": "(OrganizationalAuth || IndividualAuth || !NoHttps)" + "value": "(OrganizationalAuth || IndividualB2C || !NoHttps)" }, "NoHttps": { "type": "parameter", "datatype": "bool", "defaultValue": "false", - "description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth." + "description": "Whether to turn off HTTPS. This option only applies if IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth." }, "UseLocalDB": { "type": "parameter", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Properties/launchSettings.json b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Properties/launchSettings.json index 81462d55871b..568f4bc96666 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Properties/launchSettings.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Properties/launchSettings.json @@ -17,19 +17,28 @@ } }, "profiles": { - "BlazorServerWeb-CSharp": { + //#if(!RequiresHttps) + "http": { "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, - //#if(RequiresHttps) - "applicationUrl": "https://localhost:5001;http://localhost:5000", - //#else "applicationUrl": "http://localhost:5000", - //#endif "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } }, + //#endif + //#if(!NoHttps) + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + //#endif "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-CSharp/Properties/launchSettings.json b/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-CSharp/Properties/launchSettings.json index e341bf4f8f43..cb3a322a30d4 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-CSharp/Properties/launchSettings.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-CSharp/Properties/launchSettings.json @@ -17,19 +17,26 @@ } }, "profiles": { - "Company.WebApplication1": { + "http": { "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, - //#if(NoHttps) "applicationUrl": "http://localhost:5000", - //#else + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + //#if(!NoHttps) + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, "applicationUrl": "https://localhost:5001;http://localhost:5000", - //#endif "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } }, + //#endif "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-FSharp/Properties/launchSettings.json b/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-FSharp/Properties/launchSettings.json index 8ac0e66ef467..4f1ea4d3abfe 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-FSharp/Properties/launchSettings.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-FSharp/Properties/launchSettings.json @@ -12,19 +12,26 @@ } }, "profiles": { - "Company.WebApplication1": { + "http": { "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, - //#if(NoHttps) "applicationUrl": "http://localhost:5000", - //#else + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + //#if(!NoHttps) + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, "applicationUrl": "https://localhost:5001;http://localhost:5000", - //#endif "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } }, + //#endif "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/Properties/launchSettings.json b/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/Properties/launchSettings.json index e27b5963277c..01dd5f0d400a 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/Properties/launchSettings.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/Properties/launchSettings.json @@ -1,10 +1,19 @@ { "profiles": { - "GrpcService-CSharp": { + "http": { "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": false, - "applicationUrl": "http://localhost:5000;https://localhost:5001", + "applicationUrl": "http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": false, + "applicationUrl": "https://localhost:5001;http://localhost:5000", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/localize/templatestrings.en.json b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/localize/templatestrings.en.json index d9e25f82e1fb..98d88c50b45c 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/localize/templatestrings.en.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/localize/templatestrings.en.json @@ -24,10 +24,10 @@ "symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json in the generated template.", "symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.", "symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.", - "symbols/kestrelHttpsPort/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).", + "symbols/kestrelHttpsPort/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 IndividualB2C or OrganizationalAuth is used).", "symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.", - "symbols/iisHttpsPort/description": "Port number to use for the IIS Express 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).", - "symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.", + "symbols/iisHttpsPort/description": "Port number to use for the IIS Express 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 IndividualB2C or OrganizationalAuth is used).", + "symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.", "symbols/UseLocalDB/description": "Whether to use LocalDB instead of SQLite. This option only applies if --auth Individual or --auth IndividualB2C is specified.", "symbols/Framework/description": "The target framework for the project.", "symbols/Framework/choices/net7.0/description": "Target net7.0", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/template.json index 3f42794ce92a..7953b981f5ae 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/template.json @@ -263,7 +263,7 @@ "kestrelHttpsPort": { "type": "parameter", "datatype": "integer", - "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)." + "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 IndividualB2C or OrganizationalAuth is used)." }, "kestrelHttpsPortGenerated": { "type": "generated", @@ -303,7 +303,7 @@ "iisHttpsPort": { "type": "parameter", "datatype": "integer", - "description": "Port number to use for the IIS Express 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)." + "description": "Port number to use for the IIS Express 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 IndividualB2C or OrganizationalAuth is used)." }, "iisHttpsPortGenerated": { "type": "generated", @@ -356,13 +356,13 @@ }, "RequiresHttps": { "type": "computed", - "value": "(OrganizationalAuth || IndividualAuth || !NoHttps)" + "value": "(OrganizationalAuth || IndividualB2C || !NoHttps)" }, "NoHttps": { "type": "parameter", "datatype": "bool", "defaultValue": "false", - "description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth." + "description": "Whether to turn off HTTPS. This option only applies if IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth." }, "UseLocalDB": { "type": "parameter", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Properties/launchSettings.json b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Properties/launchSettings.json index 316f54a0fed1..4c3cf22695ea 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Properties/launchSettings.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Properties/launchSettings.json @@ -17,19 +17,28 @@ } }, "profiles": { - "Company.WebApplication1": { + //#if(!RequiresHttps) + "http": { "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, - //#if(RequiresHttps) - "applicationUrl": "https://localhost:5001;http://localhost:5000", - //#else "applicationUrl": "http://localhost:5000", - //#endif "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } }, + //#endif + //#if(!NoHttps) + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + //#endif "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/.template.config/localize/templatestrings.en.json b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/.template.config/localize/templatestrings.en.json index 4f01b0e182ba..d246072ffadf 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/.template.config/localize/templatestrings.en.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/.template.config/localize/templatestrings.en.json @@ -23,10 +23,10 @@ "symbols/UserSecretsId/description": "The ID to use for secrets (use with OrgReadAccess or Individual auth).", "symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.", "symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.", - "symbols/kestrelHttpsPort/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).", + "symbols/kestrelHttpsPort/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 IndividualB2C or OrganizationalAuth is used).", "symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.", - "symbols/iisHttpsPort/description": "Port number to use for the IIS Express 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).", - "symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.", + "symbols/iisHttpsPort/description": "Port number to use for the IIS Express 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 IndividualB2C or OrganizationalAuth is used).", + "symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.", "symbols/UseLocalDB/description": "Whether to use LocalDB instead of SQLite. This option only applies if --auth Individual or --auth IndividualB2C is specified.", "symbols/Framework/description": "The target framework for the project.", "symbols/Framework/choices/net7.0/description": "Target net7.0", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/.template.config/template.json index a2af2cbbf660..4a67c35570f6 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/.template.config/template.json @@ -253,7 +253,7 @@ "kestrelHttpsPort": { "type": "parameter", "datatype": "integer", - "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)." + "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 IndividualB2C or OrganizationalAuth is used)." }, "kestrelHttpsPortGenerated": { "type": "generated", @@ -293,7 +293,7 @@ "iisHttpsPort": { "type": "parameter", "datatype": "integer", - "description": "Port number to use for the IIS Express 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)." + "description": "Port number to use for the IIS Express 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 IndividualB2C or OrganizationalAuth is used)." }, "iisHttpsPortGenerated": { "type": "generated", @@ -346,13 +346,13 @@ }, "RequiresHttps": { "type": "computed", - "value": "(OrganizationalAuth || IndividualAuth || !NoHttps)" + "value": "(OrganizationalAuth || IndividualB2C || !NoHttps)" }, "NoHttps": { "type": "parameter", "datatype": "bool", "defaultValue": "false", - "description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth." + "description": "Whether to turn off HTTPS. This option only applies if IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth." }, "UseLocalDB": { "type": "parameter", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Properties/launchSettings.json b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Properties/launchSettings.json index 316f54a0fed1..4c3cf22695ea 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Properties/launchSettings.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Properties/launchSettings.json @@ -17,19 +17,28 @@ } }, "profiles": { - "Company.WebApplication1": { + //#if(!RequiresHttps) + "http": { "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, - //#if(RequiresHttps) - "applicationUrl": "https://localhost:5001;http://localhost:5000", - //#else "applicationUrl": "http://localhost:5000", - //#endif "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } }, + //#endif + //#if(!NoHttps) + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + //#endif "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-FSharp/Properties/launchSettings.json b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-FSharp/Properties/launchSettings.json index e341bf4f8f43..cb3a322a30d4 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-FSharp/Properties/launchSettings.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-FSharp/Properties/launchSettings.json @@ -17,19 +17,26 @@ } }, "profiles": { - "Company.WebApplication1": { + "http": { "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, - //#if(NoHttps) "applicationUrl": "http://localhost:5000", - //#else + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + //#if(!NoHttps) + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, "applicationUrl": "https://localhost:5001;http://localhost:5000", - //#endif "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } }, + //#endif "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/localize/templatestrings.en.json b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/localize/templatestrings.en.json index 34a1dd016770..b613633e7353 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/localize/templatestrings.en.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/localize/templatestrings.en.json @@ -18,10 +18,10 @@ "symbols/UserSecretsId/description": "The ID to use for secrets (use with OrgReadAccess or Individual auth).", "symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json in the generated template.", "symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.", - "symbols/kestrelHttpsPort/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).", + "symbols/kestrelHttpsPort/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 IndividualB2C or OrganizationalAuth is used).", "symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.", - "symbols/iisHttpsPort/description": "Port number to use for the IIS Express 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).", - "symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.", + "symbols/iisHttpsPort/description": "Port number to use for the IIS Express 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 IndividualB2C or OrganizationalAuth is used).", + "symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.", "symbols/UseLocalDB/description": "Whether to use LocalDB instead of SQLite. This option only applies if --auth Individual or --auth IndividualB2C is specified.", "symbols/UseMinimalAPIs/description": "Whether to use minimal APIs instead of controllers.", "symbols/Framework/description": "The target framework for the project.", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/template.json index e36961ed6345..1d5ba931913e 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/template.json @@ -209,7 +209,7 @@ "kestrelHttpsPort": { "type": "parameter", "datatype": "integer", - "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)." + "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 IndividualB2C or OrganizationalAuth is used)." }, "kestrelHttpsPortGenerated": { "type": "generated", @@ -249,7 +249,7 @@ "iisHttpsPort": { "type": "parameter", "datatype": "integer", - "description": "Port number to use for the IIS Express 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)." + "description": "Port number to use for the IIS Express 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 IndividualB2C or OrganizationalAuth is used)." }, "iisHttpsPortGenerated": { "type": "generated", @@ -294,13 +294,13 @@ }, "RequiresHttps": { "type": "computed", - "value": "(OrganizationalAuth || IndividualAuth || !NoHttps)" + "value": "(OrganizationalAuth || IndividualB2C || !NoHttps)" }, "NoHttps": { "type": "parameter", "datatype": "bool", "defaultValue": "false", - "description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth." + "description": "Whether to turn off HTTPS. This option only applies if IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth." }, "UseLocalDB": { "type": "parameter", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Properties/launchSettings.json b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Properties/launchSettings.json index 2ab450749e8e..eb193657534d 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Properties/launchSettings.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Properties/launchSettings.json @@ -18,7 +18,8 @@ } }, "profiles": { - "Company.WebApplication1": { + //#if(!RequiresHttps) + "http": { "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, @@ -27,15 +28,28 @@ //#else "launchUrl": "weatherforecast", //#endif - //#if(RequiresHttps) - "applicationUrl": "https://localhost:5001;http://localhost:5000", - //#else "applicationUrl": "http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + //#endif + //#if(!NoHttps) + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + //#if(EnableOpenAPI) + "launchUrl": "swagger", + //#else + "launchUrl": "weatherforecast", //#endif + "applicationUrl": "https://localhost:5001;http://localhost:5000", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } }, + //#endif "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/.template.config/localize/templatestrings.en.json b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/.template.config/localize/templatestrings.en.json index 10dfdafb04fe..6506f52fae6d 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/.template.config/localize/templatestrings.en.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/.template.config/localize/templatestrings.en.json @@ -4,13 +4,13 @@ "description": "A project template for creating an ASP.NET Core application with an example Controller for a RESTful HTTP service. This template can also be used for ASP.NET Core MVC Views and Controllers.", "symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.", "symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.", - "symbols/kestrelHttpsPort/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).", + "symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json.", "symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.", - "symbols/iisHttpsPort/description": "Port number to use for the IIS Express 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).", + "symbols/iisHttpsPort/description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json.", "symbols/Framework/description": "The target framework for the project.", "symbols/Framework/choices/net7.0/description": "Target net7.0", "symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.", - "symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.", + "symbols/NoHttps/description": "Whether to turn off HTTPS.", "postActions/restore/description": "Restore NuGet packages required by this project.", "postActions/restore/manualInstructions/default/text": "Run 'dotnet restore'" } \ No newline at end of file diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/.template.config/template.json index 0ae13400e2fc..bca07eaf4de7 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/.template.config/template.json @@ -61,7 +61,7 @@ "kestrelHttpsPort": { "type": "parameter", "datatype": "integer", - "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)." + "description": "Port number to use for the HTTPS endpoint in launchSettings.json." }, "kestrelHttpsPortGenerated": { "type": "generated", @@ -101,7 +101,7 @@ "iisHttpsPort": { "type": "parameter", "datatype": "integer", - "description": "Port number to use for the IIS Express 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)." + "description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json." }, "iisHttpsPortGenerated": { "type": "generated", @@ -151,7 +151,7 @@ "type": "parameter", "datatype": "bool", "defaultValue": "false", - "description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth." + "description": "Whether to turn off HTTPS." } }, "primaryOutputs": [ diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/Properties/launchSettings.json b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/Properties/launchSettings.json index e974bfdb61b2..94f27bca9195 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/Properties/launchSettings.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/Properties/launchSettings.json @@ -18,20 +18,36 @@ } }, "profiles": { - "Company.WebApplication1": { + "http": { "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, + //#if(EnableOpenAPI) + "launchUrl": "swagger", + //#else "launchUrl": "weatherforecast", - //#if(NoHttps) + //#endif "applicationUrl": "http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + //#if(!NoHttps) + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + //#if(EnableOpenAPI) + "launchUrl": "swagger", //#else - "applicationUrl": "https://localhost:5001;http://localhost:5000", + "launchUrl": "weatherforecast", //#endif + "applicationUrl": "https://localhost:5001;http://localhost:5000", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } }, + //#endif "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, diff --git a/src/ProjectTemplates/scripts/Test-Template.ps1 b/src/ProjectTemplates/scripts/Test-Template.ps1 index 1774b477356d..ca0399d2201f 100644 --- a/src/ProjectTemplates/scripts/Test-Template.ps1 +++ b/src/ProjectTemplates/scripts/Test-Template.ps1 @@ -65,7 +65,7 @@ function Test-Template($templateName, $templateArgs, $templateNupkg, $isBlazorWa Push-Location Server } if ($templateArgs -match '-au') { - dotnet.exe ef migrations add mvc + dotnet.exe ef migrations add Initial } dotnet.exe publish --configuration Release Set-Location .\bin\Release\net7.0\publish