get localhost through code core .net code example
Example: how to set the server url in dotnet core
> dotnet run --server.urls "http://localhost:5100;http://localhost:5101;http://*:5102"
> dotnet run --server.urls "http://localhost:5100;http://localhost:5101;http://*:5102"