Chris Dellinger
Chris Dellinger

Reputation: 2362

Visual Studio 2010 Ignoring Specified Port Number

I've got a Visual Studio 2010 MVC 3 Azure project that is acting very weird. When I first start it up, it runs under port 81. As I work throughout the day, the port number will increment upwards (81, 82, 83...) as I run/debug my project locally. It doesn't increment everytime. I've gone into the web role project and specified the port number, but Visual Studio ignores my entry and keeps the number it had before. I've closed down VS and done reboots, none of which has helped. Has anyone else seen something similar to this before?

Upvotes: 4

Views: 753

Answers (3)

dunnry
dunnry

Reputation: 6868

Are you sure you are not confusing the ports you can set on a web project with the ports that will run in the emulator? These are not the same. VS can use IIS Express or Cassini which will allow you to set ports for a web application. However, the Windows Azure emulator uses real IIS, which has nothing to do with the ports you choose in a web project.

The deal is that the emulator will try to take 80 and the incrementally go up one everytime it sees a reservation or bound application. Sometimes you need to restart it (and wait about 2 mins) if you see it keep getting higher and higher. Most people will see the emulator grab 81 because their IIS Default Web Site is already bound to port 80. If you want 80, just go to inetmgr and remove the port 80 binding from Default Web Site (or delete the site). Next time you start the emulator, it will grab 80.

Upvotes: 1

vtortola
vtortola

Reputation: 35905

There is nothing wrong with that, it will work in the specified port on the real cloud.

Imagine that you create a web application on port tcp 80, with 4 instances ... :) you cannot open 4 times the same port. So don't worry about that.

Cheers.

Upvotes: 0

David Makogon
David Makogon

Reputation: 71055

I see this sometimes, and usually stopping the Compute Emulator (which then restarts during next debug session) fixes it.

Upvotes: 0

Related Questions