Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2010 specific port changes at random

I'm playing around with a WCF service.

The problem I'm having is that VS2010 keeps randomly assigning a new port number to it when starting the VS Development Server even though I have set it to a specific port through the project settings.

If I keep stopping and starting VS Development Server for a few times with this problem, I get an error that says Unable to launch the ASP.NET Development server because port 'xxxx' is in use.

Why is this happening?

edit: It was suggested that this could be caused by the Dev Server not stopping. Unfortunately, it happens on a freshly started computer as well, i.e. when no instances of it are running at all.

Also, after I get the error message, it doesn't matter if I change the port, or select the Auto-assign Port option. The result is the same.

like image 593
Moss Avatar asked Jul 25 '11 17:07

Moss


2 Answers

I have seen it sometimes and it seems that the webserver doesn't stop at times. So next time you fire up your project, the previous server is running at the same port.

The solution is to explicitly close the previous one and retry.

like image 193
Mrchief Avatar answered Sep 21 '22 13:09

Mrchief


On the project properties of the web app project (right click and select Properties) Web tab, change the radio button to 'Specific Port' from auto select. That should make the port number totally consistent.

like image 41
C. Pearson Avatar answered Sep 22 '22 13:09

C. Pearson