server.urls Paramter Not Working On Kestrel Server for dotnet Command on ASP.NET Core RC2

Written by William Roush on May 21, 2016 at 3:53 am

Was struggling really hard with getting this command to work:

dotnet run -- --server.urls http://*:5000

Simple command, but it isn’t taking! Well I missed one major thing when upgrading from RC1 to RC2, I need to now pass configuration down to the Kestrel stack, to do that is pretty easy:

        public static void Main(string[] args)
            var config = new ConfigurationBuilder()
                .AddEnvironmentVariables(prefix: "ASPNETCORE_")

            var host = new WebHostBuilder()


Needed to define the “config” variable and pass it to WebHostBuilder using UseConfiguration(). All fixed!

This entry was posted in .NET and tagged , , on by .

About William Roush

William Roush is currently employed as a Senior Software Developer and independent contractor in Chattanooga, Tennessee. He has more than 12 years of experience in the IT field, with a wide range of exposure including software development, deploying and maintaining virtual infrastructure, storage administration and Windows administration.

2 thoughts on “server.urls Paramter Not Working On Kestrel Server for dotnet Command on ASP.NET Core RC2

  1. John Mark Isaac Madison

    Hey there, I was wondering where I could find the command-line documentation for ” dotnet myproject.dll –sever.urls”.

    I’am running across code examples that use “–urls” instead of “–server.urls”.
    Are these shorthand and longhand versions of the same parameter?

    1. William Roush Post author

      `-urls` is likely shorthand, at least in my experience one dash == shorthand.

      According to comments in the source `–server.urls` is mapped to the UseUrl() method. That’s all I’ve seen in relation to the subject:

      But if the shorthand works, I don’t see any reason you can’t use it.


Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.