views:

959

answers:

4

Guys,

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!

A: 

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  A: 

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
+4  A: 
k0ni
+5  A: 

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