-->

How do I change the debug port in Visual Studio 20

2020-08-12 02:21发布

问题:

How to change debug port in Visual Studio 2017? I checked the property pages but to no avail.

回答1:

For me, I was able to find it with the following steps in Visual Studio 2017:

  1. Right click on the web project, then click Properties.
  2. Click on the Debug tab.
  3. Under the Profile IIS Express, you will find the port at the App URL box.


回答2:

Go into the .sln file and edit the port there.

For example, if it's currently on port: 50722

Then just do a replace: 50722 replace with: 50723 and it should build just fine. There should be about 5 spots it'll replace.



回答3:

Project file properties

In VS 2017, I was able to update it in the project properties, instead of the solution properties.

  1. Right-click on your project file, then choose Properties.

  2. On the Web tab find the Project Url section. It should say something like

    https://localhost:44348/
    
  3. Simply modify it to your desired port number and save.