There are a bunch of different ways to do this, but sometimes I find myself wanting to run multiple web applications locally on different ports without fussing with configuration files, etc. And whenever I need to do this, I always have to look it up… but most of the posts out there are how to do it in a configuration file/setting, not just on the fly command line. So, here’s my cheatsheet:
–urls
When launching a .NET core web app, you can specify the –urls flag to specify which urls to listen to. Specifically, here’s what you type:
dotnet MyApp.dll –urls http://*:5123
You can also specify https if that’s what you need, but that will launch the application using that specific port on localhost.