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:

  1. If the Properties window in Visual Studio is not already opened, open it with "F4" or via the toolbar - "View" -> "Properties Window".
  2. Left click on your web site in the "Solution Explorer" window.
  3. 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.
  4. Launch your web site.  You'll see the port used matches the value you specified.

Mark Berryman