Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parameters in .NET Core docker launchSettings.json

I am writing an ASP.NET Core application and I have a launchSettings.json file with the following content:

{
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:50251",
      "sslPort": 44349
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "AspNetDockerDemo": {
      "commandName": "Project",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "applicationUrl": "https://localhost:5001;http://localhost:5000"
    },
    "Docker": {
      "commandName": "Docker",
      "launchBrowser": true,
      "launchUrl": "{Scheme}://{ServiceHost}"
    }
  }
}

Question: Where are the { } placeholders substituded and where are the values definied by which they are substituted? What will I have to do if I want to define such values on my own?

like image 969
Daniel Avatar asked Sep 21 '18 13:09

Daniel


People also ask

Is launchSettings JSON used in Docker?

In launchSettings. json, the settings in the Docker section are related to how Visual Studio handles containerized apps. These command-line arguments for starting your app are used when launching your project in the container. Additional arguments to pass to the docker run command.

What is launchSettings JSON in .NET Core?

The launchSettings. json file is used to store the configuration information, which describes how to start the ASP.NET Core application, using Visual Studio. The file is used only during the development of the application using Visual Studio. It contains only those settings that required to run the application.


1 Answers

This doesn't answer your question, but if you're asking because you want consistent host port numbers while debugging like I did, you can do this by adding httpPort and sslPort to the launchSettings.json file.

enter image description here

like image 190
adam0101 Avatar answered Sep 18 '22 09:09

adam0101