0

I got this error out of nowhere. I tried everything here - How to solve “Microsoft Visual Studio (VS)” error “Unable to connect to the configured development Web server”

and nothing works. I'm using VS 2017.

error message:

the error messege

Microsoft's suggestion: enter image description here

EDIT: tried changing the port in the "applicationhost.config" file - didn't work, just made another "WebSite". so in solution manager - instead of WebSite1 (1), it became WebSite (2), dammit! :( why can't I change ports without it making a new website and sticking to the same one?

kfir ezer
  • 159
  • 1
  • 11
  • Is there any chance you could use IIS instead of IIS Express? – Andrew Morton May 04 '20 at 17:54
  • how to switch them? also, on paper, this should work: I just try to change the port and it should connect from the new port. but for some reason, it can't connect to anything but the same (already used) port. – kfir ezer May 04 '20 at 18:07

1 Answers1

0

To change the port for the project, we need to change the IIS express settings for the current project.
Above the VS2017, the configuration file of IIS Express located in the below directory.

SolutionName/.vs/SolutionName/config/applicationhost.config

Go to the actual section for the project, such as,

<site name="WebApplication1" id="2">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="C:\Users\Administrator\source\repos\VsGit-\Test\WebApplication1" />
    </application>
    <bindings>
        <binding protocol="http" bindingInformation="*:56697:" />
        <binding protocol="https" bindingInformation="*:44323:" />
    </bindings>

56697 and 44323 port are the specific port for the website, change it and save the file, then we restart IIS express/Visual Studio, that’s all.
Note: Restart action is necessary for applying the latest configuration in IIS Express.
Feel free to let me know if the problem still exists.

Abraham Qian
  • 7,117
  • 1
  • 8
  • 22
  • 1
    so basically, the reason that it didn't work was that I was changing it to the wrong port number. I'll try. – kfir ezer May 07 '20 at 09:40