Tip #21: Did you know...How to set a fixed port for the Developer Web Server?
When you create a file based web site, the "Developer Web Server" is fired up on a local port to serve the web site. By default, the port value used is dynamic based on a pre-defined range and the availability of a port. In some situations, you might want the web server to always use a fixed port value.
Here's how to do configure this:
- If the Properties window in Visual Studio is not already opened, open it with "F4" or via the toolbar - "View" -> "Properties Window".
- Left click on your web site in the "Solution Explorer" window.
- You'll now see a dialog similar to the following:
Notice the drop down list for the "Use dynamic ports" setting. If you set this to "False", you'll then be able to specify a fixed port in the "Port number" field. Set this to your desired port value.
- Launch your web site. You'll see the port used matches the value you specified.
Mark Berryman
SDET, ASP.NET QA Team