Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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!

like image 297
pencilCake Avatar asked Oct 16 '09 09:10

pencilCake


People also ask

How do I change the localhost port in Visual Studio?

In Solution Explorer, right-click the name of the web application and select Properties. Click the Web tab. In the Servers section, under dropdown selection for IIS Express, change the port number in the Project URL box. To the right of the Project URL box, click Create Virtual Directory, and then click OK.

How do I change the port number in .NET core?

To change the port the application is using, Open the file lunchSetting. json. You will find it under the properties folder in your project and as shown below. Inside the file, change applicationUrl port (below is set to 5000) to a different port number and save the file.


2 Answers

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

like image 95
Moayad Mardini Avatar answered Oct 18 '22 17:10

Moayad Mardini


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

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

like image 42
k0ni Avatar answered Oct 18 '22 18:10

k0ni