How does Visual Studio decide which port to run applications on?
By default, ASP.NET Web Application Projects are configured to launch and run using the built-in VS Web Server (aka Cassini) on a random HTTP port on the machine.
This port number can be changed if this port is already in use, or if you want to specifically test and run using a different number:
(source: scottgu.com)
I know this is a little bit old, but I was wondering the same thing. I eventually found the answer for VS2005, but figured I'd share it with the stack overflow community.
- Open your project
- Click (not right click) on the name of the project in the solution explorer (that top, bolded line)
- Hit f4 - this will bring up a properties panel
- Change "Use dynamic ports" to False
- Optionally change the Port number to whatever port you want to use
And you're done.