How the localhost port number of .NET Development Server set?

.net, localhost, port

Solution

It's just a random number:

When you use the ASP.NET Development Server to run a file-system Web site, by default, the Web server is invoked on a randomly selected port for localhost.

Although you can specify it yourself by disabling dynamic ports.

Take a look at : How to: Specify a Port for the ASP.NET Development Server

Problem

I see that time to time localhost port number changes (http://localhost:1519/ ....). Basically how does it being set or chosen? And when does it change? Thanks!

Original source

Related problems