Skip to content

Date archive for: November 2016

Specifying a Port Number to the dotnet run Command in ASP.Net Core

ASP.Net core lets you run a web server for your web application from the command line with the command: dotnet run But there is no command argument passing the port to listen on. For example in Ruby on Rails you could specify the port with the –port (-p) argument: rails server –port 2000 Instead ASP.Net Core uses the environment variable ASPNETCORE_URLS to take a string representation of the port and hostname of the server. If you want to change the port that the server listens on at the command line you will need to set the environment variable. Which you can do within the scope of the…

Continue reading Specifying a Port Number to the dotnet run Command in ASP.Net Core