Skip to content

Commit fe46b28

Browse files
DamianEdwardscaptainsafia
authored andcommitted
Change project templates to have separate "http" and "https" launch profiles (dotnet#42027)
* Project templates have separate "http" and "https" launch profiles * Update test targets for dotnet-ef targeting net6.0 Fixes dotnet#41982
1 parent e73c2cb commit fe46b28

File tree

22 files changed

+168
-72
lines changed

22 files changed

+168
-72
lines changed

AspNetCore.sln

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1728,6 +1728,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MinimalJwtBearerSample", "s
17281728
EndProject
17291729
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}"
17301730
EndProject
1731+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TestInfrastructure", "TestInfrastructure", "{F0FBA346-D8BC-4FAE-A4B2-85B33FA23055}"
1732+
ProjectSection(SolutionItems) = preProject
1733+
src\ProjectTemplates\TestInfrastructure\Directory.Build.props.in = src\ProjectTemplates\TestInfrastructure\Directory.Build.props.in
1734+
src\ProjectTemplates\TestInfrastructure\Directory.Build.targets.in = src\ProjectTemplates\TestInfrastructure\Directory.Build.targets.in
1735+
src\ProjectTemplates\TestInfrastructure\PrepareForTest.targets = src\ProjectTemplates\TestInfrastructure\PrepareForTest.targets
1736+
src\ProjectTemplates\TestInfrastructure\runtimeconfig.norollforward.json = src\ProjectTemplates\TestInfrastructure\runtimeconfig.norollforward.json
1737+
EndProjectSection
1738+
EndProject
17311739
Global
17321740
GlobalSection(SolutionConfigurationPlatforms) = preSolution
17331741
Debug|Any CPU = Debug|Any CPU
@@ -11233,6 +11241,7 @@ Global
1123311241
{AB4B9E75-719C-4589-B852-20FBFD727730} = {0B200A66-B809-4ED3-A790-CB1C2E80975E}
1123411242
{7F079E92-32D5-4257-B95B-CFFB0D49C160} = {7FD32066-C831-4E29-978C-9A2215E85C67}
1123511243
{89896261-C5DD-4901-BCA7-7A5F718BC008} = {AB4B9E75-719C-4589-B852-20FBFD727730}
11244+
{F0FBA346-D8BC-4FAE-A4B2-85B33FA23055} = {08D53E58-4AAE-40C4-8497-63EC8664F304}
1123611245
EndGlobalSection
1123711246
GlobalSection(ExtensibilityGlobals) = postSolution
1123811247
SolutionGuid = {3E8720B3-DBDD-498C-B383-2CC32A054E8F}

src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<ItemGroup>
33
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
44
<_Parameter1>DotNetEfFullPath</_Parameter1>
5-
<_Parameter2>$([MSBuild]::EnsureTrailingSlash('$(NuGetPackageRoot)'))dotnet-ef/$(DotnetEfVersion)/tools/netcoreapp3.1/any/dotnet-ef.dll</_Parameter2>
5+
<_Parameter2>$([MSBuild]::EnsureTrailingSlash('$(NuGetPackageRoot)'))dotnet-ef/$(DotnetEfVersion)/tools/net6.0/any/dotnet-ef.dll</_Parameter2>
66
</AssemblyAttribute>
77
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
88
<_Parameter1>TestPackageRestorePath</_Parameter1>

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/.template.config/localize/templatestrings.en.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
"symbols/UserSecretsId/description": "The ID to use for secrets (use with OrgReadAccess or Individual auth).",
2424
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
2525
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
26-
"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).",
26+
"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).",
2727
"symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.",
28-
"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).",
29-
"symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.",
28+
"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).",
29+
"symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.",
3030
"symbols/UseLocalDB/description": "Whether to use LocalDB instead of SQLite. This option only applies if --auth Individual or --auth IndividualB2C is specified.",
3131
"symbols/Framework/description": "The target framework for the project.",
3232
"symbols/Framework/choices/net7.0/description": "Target net7.0",

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/.template.config/template.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@
341341
"kestrelHttpsPort": {
342342
"type": "parameter",
343343
"datatype": "integer",
344-
"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)."
344+
"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)."
345345
},
346346
"kestrelHttpsPortGenerated": {
347347
"type": "generated",
@@ -381,7 +381,7 @@
381381
"iisHttpsPort": {
382382
"type": "parameter",
383383
"datatype": "integer",
384-
"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)."
384+
"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)."
385385
},
386386
"iisHttpsPortGenerated": {
387387
"type": "generated",
@@ -434,13 +434,13 @@
434434
},
435435
"RequiresHttps": {
436436
"type": "computed",
437-
"value": "(OrganizationalAuth || IndividualAuth || !NoHttps)"
437+
"value": "(OrganizationalAuth || IndividualB2C || !NoHttps)"
438438
},
439439
"NoHttps": {
440440
"type": "parameter",
441441
"datatype": "bool",
442442
"defaultValue": "false",
443-
"description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth."
443+
"description": "Whether to turn off HTTPS. This option only applies if IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth."
444444
},
445445
"UseLocalDB": {
446446
"type": "parameter",

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Properties/launchSettings.json

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,28 @@
1717
}
1818
},
1919
"profiles": {
20-
"BlazorServerWeb-CSharp": {
20+
//#if(!RequiresHttps)
21+
"http": {
2122
"commandName": "Project",
2223
"dotnetRunMessages": true,
2324
"launchBrowser": true,
24-
//#if(RequiresHttps)
25-
"applicationUrl": "https://localhost:5001;http://localhost:5000",
26-
//#else
2725
"applicationUrl": "http://localhost:5000",
28-
//#endif
2926
"environmentVariables": {
3027
"ASPNETCORE_ENVIRONMENT": "Development"
3128
}
3229
},
30+
//#endif
31+
//#if(!NoHttps)
32+
"https": {
33+
"commandName": "Project",
34+
"dotnetRunMessages": true,
35+
"launchBrowser": true,
36+
"applicationUrl": "https://localhost:5001;http://localhost:5000",
37+
"environmentVariables": {
38+
"ASPNETCORE_ENVIRONMENT": "Development"
39+
}
40+
},
41+
//#endif
3342
"IIS Express": {
3443
"commandName": "IISExpress",
3544
"launchBrowser": true,

src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-CSharp/Properties/launchSettings.json

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,26 @@
1717
}
1818
},
1919
"profiles": {
20-
"Company.WebApplication1": {
20+
"http": {
2121
"commandName": "Project",
2222
"dotnetRunMessages": true,
2323
"launchBrowser": true,
24-
//#if(NoHttps)
2524
"applicationUrl": "http://localhost:5000",
26-
//#else
25+
"environmentVariables": {
26+
"ASPNETCORE_ENVIRONMENT": "Development"
27+
}
28+
},
29+
//#if(!NoHttps)
30+
"https": {
31+
"commandName": "Project",
32+
"dotnetRunMessages": true,
33+
"launchBrowser": true,
2734
"applicationUrl": "https://localhost:5001;http://localhost:5000",
28-
//#endif
2935
"environmentVariables": {
3036
"ASPNETCORE_ENVIRONMENT": "Development"
3137
}
3238
},
39+
//#endif
3340
"IIS Express": {
3441
"commandName": "IISExpress",
3542
"launchBrowser": true,

src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-FSharp/Properties/launchSettings.json

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,26 @@
1212
}
1313
},
1414
"profiles": {
15-
"Company.WebApplication1": {
15+
"http": {
1616
"commandName": "Project",
1717
"dotnetRunMessages": true,
1818
"launchBrowser": true,
19-
//#if(NoHttps)
2019
"applicationUrl": "http://localhost:5000",
21-
//#else
20+
"environmentVariables": {
21+
"ASPNETCORE_ENVIRONMENT": "Development"
22+
}
23+
},
24+
//#if(!NoHttps)
25+
"https": {
26+
"commandName": "Project",
27+
"dotnetRunMessages": true,
28+
"launchBrowser": true,
2229
"applicationUrl": "https://localhost:5001;http://localhost:5000",
23-
//#endif
2430
"environmentVariables": {
2531
"ASPNETCORE_ENVIRONMENT": "Development"
2632
}
2733
},
34+
//#endif
2835
"IIS Express": {
2936
"commandName": "IISExpress",
3037
"launchBrowser": true,

src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/Properties/launchSettings.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
{
22
"profiles": {
3-
"GrpcService-CSharp": {
3+
"http": {
44
"commandName": "Project",
55
"dotnetRunMessages": true,
66
"launchBrowser": false,
7-
"applicationUrl": "http://localhost:5000;https://localhost:5001",
7+
"applicationUrl": "http://localhost:5000",
8+
"environmentVariables": {
9+
"ASPNETCORE_ENVIRONMENT": "Development"
10+
}
11+
},
12+
"https": {
13+
"commandName": "Project",
14+
"dotnetRunMessages": true,
15+
"launchBrowser": false,
16+
"applicationUrl": "https://localhost:5001;http://localhost:5000",
817
"environmentVariables": {
918
"ASPNETCORE_ENVIRONMENT": "Development"
1019
}

src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/localize/templatestrings.en.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json in the generated template.",
2525
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
2626
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
27-
"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).",
27+
"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).",
2828
"symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.",
29-
"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).",
30-
"symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.",
29+
"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).",
30+
"symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.",
3131
"symbols/UseLocalDB/description": "Whether to use LocalDB instead of SQLite. This option only applies if --auth Individual or --auth IndividualB2C is specified.",
3232
"symbols/Framework/description": "The target framework for the project.",
3333
"symbols/Framework/choices/net7.0/description": "Target net7.0",

src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/template.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@
263263
"kestrelHttpsPort": {
264264
"type": "parameter",
265265
"datatype": "integer",
266-
"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)."
266+
"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)."
267267
},
268268
"kestrelHttpsPortGenerated": {
269269
"type": "generated",
@@ -303,7 +303,7 @@
303303
"iisHttpsPort": {
304304
"type": "parameter",
305305
"datatype": "integer",
306-
"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)."
306+
"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)."
307307
},
308308
"iisHttpsPortGenerated": {
309309
"type": "generated",
@@ -356,13 +356,13 @@
356356
},
357357
"RequiresHttps": {
358358
"type": "computed",
359-
"value": "(OrganizationalAuth || IndividualAuth || !NoHttps)"
359+
"value": "(OrganizationalAuth || IndividualB2C || !NoHttps)"
360360
},
361361
"NoHttps": {
362362
"type": "parameter",
363363
"datatype": "bool",
364364
"defaultValue": "false",
365-
"description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth."
365+
"description": "Whether to turn off HTTPS. This option only applies if IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth."
366366
},
367367
"UseLocalDB": {
368368
"type": "parameter",

0 commit comments

Comments
 (0)