Search code examples
c#asp.net-corevisual-studio-2019iis-express.net-5

Visual studio 2019 “Unable to connect to web server 'IIS Express'”


I attempt to lunch my ASP.NET Core project in Microsoft Visual Studio 2019 and got this error: "Unable to connect to web server 'IIS Express'"

  • Visual Studio 2019 Version 16.9.5
  • .Net 5.0

Solution

  • I tried this one and it worked for me:

    1. Go to 'Debug Properties'

    2. Find 'Web Server Settings'

    3. Change the port in 'App URL' section and save the changes

    4. Run the application and the same error will appear again

    5. Switch the port back to the original port and save the changes

    6. Run the application and enjoy it!

    I hope this trick work for you.