© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
1 reply
M B V R K

❔ How to set a custom start URL for an API from launch.json (VS Code)

I'm working on an
ASP.Net core 7
ASP.Net core 7
web API, I use
VS Code
VS Code
, in the
launch.json
launch.json
file I have this configuration:
      "name": "Backend API",
      "type": "coreclr",
      "request": "launch",
      "preLaunchTask": "build",
      // If you have changed target frameworks, make sure to update the program path.
      "program": "${workspaceFolder}/src/Web.API/bin/Debug/net7.0/Web.API.dll",
      "args": [],
      "cwd": "${workspaceFolder}/src/Web.API",
      "stopAtEntry": false,
      // Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
      "serverReadyAction": {
        "action": "openExternally",
        "pattern": "\\bNow listening on:\\s+(https?://\\S+)"
      },
      "env": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "sourceFileMap": {
        "/Views": "${workspaceFolder}/Views"
      }
      "name": "Backend API",
      "type": "coreclr",
      "request": "launch",
      "preLaunchTask": "build",
      // If you have changed target frameworks, make sure to update the program path.
      "program": "${workspaceFolder}/src/Web.API/bin/Debug/net7.0/Web.API.dll",
      "args": [],
      "cwd": "${workspaceFolder}/src/Web.API",
      "stopAtEntry": false,
      // Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
      "serverReadyAction": {
        "action": "openExternally",
        "pattern": "\\bNow listening on:\\s+(https?://\\S+)"
      },
      "env": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "sourceFileMap": {
        "/Views": "${workspaceFolder}/Views"
      }

When I start the app, it goes directly to
http://localhost:5272/
http://localhost:5272/
, but I want it to directly go to
http://localhost:5272/Swagger
http://localhost:5272/Swagger
.
Please does anyone here knows how to do it ?

Massive thanks in advance <3
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

miDebuggerPath on launch.json error on vs code
C#CC# / help
3y ago
How to Share a project from VS code?
C#CC# / help
4y ago
❔ Models for JSON from API
C#CC# / help
4y ago
How to start coding C# in vs code??
C#CC# / help
17mo ago