how can I start the ASP.NET Core with the dotnet CLI samples so that they don't listen to the localhost?
This command doesn't work:
dotnet run --server.urls=http://*:5000
how can I start the ASP.NET Core with the dotnet CLI samples so that they don't listen to the localhost?
This command doesn't work:
dotnet run --server.urls=http://*:5000
What you're trying to do requires you to add command-line args to your configuration in the
Main
method of your application. Add something like this before you create yourWebHostBuilder
object:And then add this to the
WebHostBuilder
object before calling.Build()
on it:.UseConfiguration(config)
You'll also need to add a dependency to project.json:
"Microsoft.Extensions.Configuration.CommandLine": "1.0.0-rc2-final",
And finally, add a using statement to the file that your
Main
method is in:using Microsoft.Extensions.Configuration;
Example
Main
method: