10

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!

pencilCake
  • 51,323
  • 85
  • 226
  • 363

4 Answers4

8

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

Moayad Mardini
  • 7,271
  • 5
  • 41
  • 58
  • This is no longer an option in VS 2013, see http://stackoverflow.com/questions/22822209/changing-project-port-number-in-visual-studio-2013 – cchamberlain Mar 27 '15 at 18:04
5

You can set it here: Choose "Use dynamic port = false"

alt text http://img110.imageshack.us/img110/8444/59650554.jpg

k0ni
  • 2,417
  • 4
  • 22
  • 25
4

The setting is placed in the properties of the project. Right click your project file and chose the Web Tab. If it is set to Auto-assigned Port, the Visual studio would randomly give you a port number. But you could chose the Specific port to assign your own port number.

daxsorbito
  • 1,810
  • 21
  • 24
0

You can set this in the properties window on the website, there is an option to assign it as dynamic or choose a fixed port called "Use dynamic port", set this to false and then choose your port number.

Rob West
  • 5,189
  • 1
  • 27
  • 42