Moritz Schmidt
Moritz Schmidt

Reputation: 2823

launchSettings.json commandName usage

Everytime I find some launchSettings.json files, they have the following structure:

{
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:40088/",
      "sslPort": 0
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "IIS Express (Staging)": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Staging"
      }
    }
  }
}

found here.

However, I can't find any document about the attribute commandName.

What is the usage of commandName?

Upvotes: 28

Views: 14962

Answers (2)

A. Morel
A. Morel

Reputation: 10384

The value of commandName can specify the web server to launch. commandName can be any one of the following:

  • IISExpress : Launches IIS Express.
  • IIS : No web server launched. IIS is expected to be available.
  • Project : Launches Kestrel.

Source Microsoft => Use multiple environments in ASP.NET Core

Kestrel is a cross-platform web server for ASP.NET Core.

Upvotes: 12

Henk Mollema
Henk Mollema

Reputation: 46641

The command name maps to how the project should be started. Visual Studio uses this to run your project.

  • IISExpress obviously indicates that IIS Express is used to start the project.
  • Project indicates that the project is executed with the .NET CLI directly on the command line.

command names

Upvotes: 35

Related Questions