0

MSDN says there should be an option in the Properties pane to change the port. There isn't.

enter image description here

How can you change the port of your local web server in Visual Studio 2015 community edition?

EDIT: I believe part of the problem may be that I'm doing a web site projet, not a web application project and those are different for how they allow you to access ports.

The bottom line is, I can't start up the server because something is using the same port.

levininja
  • 3,118
  • 5
  • 26
  • 41
  • Try this: http://stackoverflow.com/a/36872160/369 – Blorgbeard Sep 08 '16 at 23:33
  • Sorry @Blorgbeard but that didn't work...I can change all instances of the port in the .sln file, but when I open VS it just changes them all back :-( – levininja Sep 08 '16 at 23:47
  • Note for others with this problem: you may get the website you need by right-clicking IIS Express (in Windows, this is in the lower right hand side) and under View Sites selecting the site you're trying to load. – levininja Aug 02 '17 at 20:33

2 Answers2

2

The option doesn't exist in the enterprise edition either. It seems to be stored in

[My Documents]\Visual Studio 2015\Projects[Your Web Site Name].vs\config\applicationhost.config

You should search for the current port number and replace it.

Miniver Cheevy
  • 1,667
  • 2
  • 14
  • 20
  • Thanks for the tip, but no dice. If I change all instances of the port in the .sln file, then when VS opens the project, it just changes it all in that file. – levininja Sep 08 '16 at 23:44
  • The page you linked too above isn't for 2015, the highest version in the other versions list is 2010. When I opened up a folder as a web site it also created a .webinfo file but I can't find any information on it's schema anywhere. – Miniver Cheevy Sep 08 '16 at 23:48
  • the page I linked to was the best documentation I could find; it doesn't list what version it is; let me know if you find something else that's supposed to be correct – levininja Sep 08 '16 at 23:55
  • 1
    No luck on better docs, I'm wondering if support for it was dropped at least in the ui. Have a look at [My Documents]\Visual Studio 2015\Projects\[Your Web Site Name]\.vs\config\applicationhost.config and try searching for and editing the current port number. – Miniver Cheevy Sep 09 '16 at 00:20
  • That did it for me! Thanks so much! Feel free to post that as the answer so I can accept it. – levininja Sep 09 '16 at 16:12
  • Somewhat misleading. I don't have my projects under [My Documents] and my server doesn't deliver a website. The path is just the project's path + .vs\config\applicationhost.config. – The incredible Jan Aug 04 '21 at 07:01
0

Bases on @levininja's comment, I managed to solve the error by following the below instructions:

Open visual studio solution file *.sln in your project folder and look for:

VWDPort = "54638"

The default port number may be different than mine. In my case it is 54638.

Change the port to the port number you want.

Frits
  • 7,341
  • 10
  • 42
  • 60
Wai Myo Kyaw
  • 1
  • 1
  • 1