Kestrel port settings in VS2017 are ignored

I have a problem starting the Kestrel server from VS2017. In VS2015, launchSettings.jsonI was able to set the port as follows:

"Kestrel": {
  "launchUrl": "http://localhost:5010/api",
  "environmentVariables": {
    "ASPNETCORE_URLS": "http://localhost:5010"
}

Now this setting is ignored by the kestrel. If I change the name of the parameter:, "ASPNETCORE_SERVER.URLS"I get a warning about outdated settings, which indicates that the file launchSettings.jsonis still being processed.

I also tried using other port environment variable settings ( ASPNETCORE_URLS), but with dotnet run --server.urls http://0.0.0.0:5010no.

+4
source share
1 answer

On VS2017, something like this works for me

"profiles": {
    "Kestrel": {
      "commandName": "Project",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "applicationUrl": "http://localhost:2287"
    }
}

Running the application on port 2287

0

Source: https://habr.com/ru/post/1674002/


All Articles