title: Setting a Port in both project.json and launchSettings.json
body: <p>I want my project to start on a particular port using both IIS Express and Kestrel in Visual Studio, using the 'IIS Express' or 'web' start button.</p>
  
  <p>By default, the launchSettings.json file contains a specific port number for IIS Express. However, Kestrel is always started on the default port 5000. How can I get Kestrel to also start on the same port as IIS Express?</p>
  
  <h1>launchSettings.json</h1>
  
  <pre><code>{
    "iisSettings": {
      "windowsAuthentication": false,
      "anonymousAuthentication": true,
      "iisExpress": {
        "applicationUrl": "http://localhost:5020/",
        "sslPort": 44320
      }
    },
    "profiles": {
      "IIS Express": {
        "commandName": "IISExpress",
        "launchBrowser": true,
        "environmentVariables": {
          "Hosting:Environment": "Development"
        }
      },
      "web": {
        "commandName": "web",
        "environmentVariables": {
          "Hosting:Environment": "Development"
        }
      }
    }
  }
  </code></pre>
  
  <h1>project.json Extract</h1>
  
  <pre><code>{
      ...
      "commands": {
          "web": "Microsoft.AspNet.Server.Kestrel"
      },
      ...
  }
  </code></pre>
  
  <p>I have tried changing the web command in project.json to:</p>
  
  <pre><code>"web": "Microsoft.AspNet.Server.Kestrel  --server.urls http://localhost:5020"
  </code></pre>
  
  <p>However, this completely stops the site starting in IIS Express.</p>