asp.net-coreasp.net-core-3.1

Is there a personal launchsetings.json file?


ASP.NET Core uses a launchsettings.json file to store settings how to start the application for debugging. Is there a way to extend this file with a personal version of it, that is not checked in into source control?

My goal is to be able to move the launchUrl around to whatever I am working on at the moment without forcing it on the other team members.

For the appsettings.json file, there is the user secrets file that can achieve exactly that, but for the launchsettings.json I couldn't find anything.

Edit: I created a feature suggestion with Microsoft for this. It could use some support to be considered though: https://developercommunity.visualstudio.com/t/Allow-personal-launchSettings-file/10618015


Solution

  • Instead of having multiple launch settings we have multiple launch profiles. You can make another profile in your launchsettings file with different launchurl like example below:

    "Sample": {
          "commandName": "Project",
          "launchBrowser": true,
          "applicationUrl": "https://localhost:5001;http://localhost:5000",
          "environmentVariables": {
            "ASPNETCORE_ENVIRONMENT": "development"
          }
        }
    

    You and your team can switch to different launch profiles while you are working separately.

    select launch

    you can select a different launch profile from the above-mentioned start dropdown from the visual studio.