Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to open solution containing website due to port being less than 1024?

I recently had to remap my solution to a new directory, upon trying to reload the solution in visual studio 2010 I get the error message:

"Cannot open Web Site 'http ://localhost/XXX'. You must run Visual Studio in the context of an administrator account to create IIS Express sites with ports less than 1024."

This is strange because as far as I can tell, the port defined in the solution file is well above port 1024. And the only advice I can find requires that I open the solution in VS (funny little catch 22 right?).

The solution worked before I remapped and re-downloaded the solution from TFS.

This is in remote apps, so I don't have access to actually run VS as an administrator.

like image 622
cDecker32 Avatar asked Mar 14 '13 19:03

cDecker32


2 Answers

I had the same issue after updating Visual Studio 2017. I opened up each affected project file and removed the contents in the IISUrl and the project reloads correctly. Weird since both UseIISExpress and UseIIS were set to False.

I also tried typetrice's solution and it worked too.

like image 148
DarrylC Avatar answered Nov 15 '22 12:11

DarrylC


Figured out a solution a while ago, but forgot to post the answer here just in case someone else stumbled across this one day.

If you open the solution file containing the project, you need to remove any instance of 'localhost' where the website in question is referenced. This seems to do the trick.

My guess is VS sees the 'localhost' and assumes you're trying to actually open a site on the local machine, or bind it to that address. Which would explain the port error.

like image 26
cDecker32 Avatar answered Nov 15 '22 10:11

cDecker32