By default, Visual Studio and Visual Web Developer Express, randomly or dynamically assigns a TCP port to a new Web Site or Web Application when you create them. This is just fine when you’re testing functionality, but not so when you need to test access etc. after moving it to IIS. Now, here is how you change it:
Web Site Project (WSP)
- Right-click the Web site in Solution Explorer.
- Press F4 to open the Properties window, if not already open.
- In the Properties window, click False in the Use dynamic ports list.
- In the Port number box, type the desired port number.
Web Application project (WAP)
- Right-click the project in Solution Explorer, and then click Properties.
- In the Properties dialog box, click the Web tab.
- On the Web tab, click the Specific port option, and type the port number in the box next to the Specific port option.
- Close the Options dialog box.