April 21, 2012

How to fix local host port number in visual studio

Recently I have faced an issue, how to fix the localhost port number in visual studio. With visual studio's default behavior, it changes the port number randomly (by checking any available port). But for some testing purpose I need it be retain at fixed number, so that I could refer the site with some static url for a specific timespan.

Following are the steps to set the fixed/static port number:
  • Select the website project node in solution explorer.
  • Right-click > Properties, OR press F4.
  • Set Use dynamic ports to false.
  • Enter any fixed available port number in the field Port number.

Now your localhost website's url remains on static port while you rerun you website.

No comments:

Post a Comment