Skip to content

Commit 289d101

Browse files
committed
Disable launching browser on Web API template (#57682)
## Description Earlier in this release cycle, we removed the Swagger UI from the built-in templates and updated the launch URL on the Web API templates to point to the `/weatherforecast` endpoint. Recently, we discovered that this default might be problematic for scenarios where the templates are instantiated with authentication configured. In this case, navigating to `/weatherforecast` on launch will result in 401 errors as the browser is unauthenticated. This sparked conversation about whether it was meaningful to launch URL to this endpoint at all and we decided to remove it in favor of allowing editors/users to configure the launch behavior as desired by their launch configuration. Resolve dotnet/AspNetCore-ManualTests#3002. ## Customer Impact Prior to this PR, customers that are creating new templates with authentication enabled might see confusing behavior when launching their applications without authentication configured correctly. ## Regression? - [ ] Yes - [X] No ## Risk - [ ] High - [ ] Medium - [X] Low This change only impacts the Web API templates in .NET 9 and beyond and doesn't affect the runtime behavior of the application. ## Verification - [X] Manual (required) - [ ] Automated ## Packaging changes reviewed? - [ ] Yes - [ ] No - [X] N/A
1 parent 981a362 commit 289d101

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
"http": {
66
"commandName": "Project",
77
"dotnetRunMessages": true,
8-
"launchBrowser": true,
9-
"launchUrl": "weatherforecast",
8+
"launchBrowser": false,
109
"applicationUrl": "http://localhost:5000",
1110
"environmentVariables": {
1211
"ASPNETCORE_ENVIRONMENT": "Development"
@@ -21,8 +20,7 @@
2120
"https": {
2221
"commandName": "Project",
2322
"dotnetRunMessages": true,
24-
"launchBrowser": true,
25-
"launchUrl": "weatherforecast",
23+
"launchBrowser": false,
2624
"applicationUrl": "https://localhost:5001;http://localhost:5000",
2725
"environmentVariables": {
2826
"ASPNETCORE_ENVIRONMENT": "Development"

0 commit comments

Comments
 (0)