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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With