How to specify the port an ASP.NET Core application is hosted on?
Asked 07 September, 2021
Viewed 1.9K times
  • 56
Votes

When using WebHostBuilder in a Main entry-point, how can I specify the port it binds to?

By default it uses 5000.

Note that this question is specific to the new ASP.NET Core API (currently in 1.0.0-RC2).

12 Answer