title: .NET Core web API change default port (5000)
body: <p>I have two applications in .NET Core 2.2. I need to host both on Centos7. One of them works correctly, on port 5000. I'm trying run second and i have a problem with change of port 5000 to another. In Program.cs i changed:</p>
  
  <pre><code>    public static IWebHostBuilder CreateWebHostBuilder(string[] args) =&gt;
          WebHost.CreateDefaultBuilder(args)
              .UseUrls("http://localhost:5200")
              .UseKestrel()
              .UseStartup&lt;Startup&gt;();
  </code></pre>
  
  <p>But it doesnt work. 
  I run aplication by service. Its my configuration</p>
  
  <pre><code>    [Unit]
      Description=ASP.Net Project
  
      [Service]
      WorkingDirectory=/home/piotrekb3/etc/slotsapi
      ExecStart=/usr/bin/dotnet /home/piotrekb3/etc/slotsapi/Slots.WebApi.dll
      Restart=always
      RestartSec=10
      SyslogIdentifier=SlotsApi
      User=piotrekb3
      Environment=ASPNETCORE_ENVIRONMENT=Production
      Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false
  
      [Install]
      WantedBy=multi-user.target
  </code></pre>
  
  <p>I run by command: </p>
  
  <pre><code>systemctl start slotsapi.service
  </code></pre>
  
  <p>I tried also change in lanuchSettings.json:</p>
  
  <pre><code>"Slots.WebApi": {
    "commandName": "Project",
    "launchBrowser": true,
    "launchUrl": "api/values",
    "applicationUrl": "https://localhost:5003;http://localhost:5004",
    "environmentVariables": {
      "ASPNETCORE_ENVIRONMENT": "Development"
    }
  }
  </code></pre>
  
  <p>But nothing.
  Any idea how can i resolve my problem?</p>