Reputation: 22247
When you run an application from within visual studio, it seems to pick a random port on localhost. For example, running an application right now, I get
I realize this port gets loaded into the solution file, via
VWDPort = "3240"
How does this get decided on? it seems fairly random.
Upvotes: 10
Views: 12054
Reputation: 187040
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)
Upvotes: 8
Reputation: 17732
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.
And you're done.
Upvotes: 5
Reputation: 22857
Check out the Properties of your web application in solution explorer (Right click > Properties)
The web tab is the one you are looking for.
Kindness,
Dan
Upvotes: 0
Reputation: 4758
This port number is initially assigned randomly, but Visual Studio will try to use that same port number every time the application starts.
Upvotes: 1