If you're getting the error "Unable to connect to the configured web development web server" in Visual Studio , it usually means there's a problem with IIS Express, your project settings, or something blocking the server (like a firewall or a busy port).
Here’s how you can fix it step by step:
1. Check if IIS Express is Running
Look at the icons near your clock (system tray) and see if the IIS Express icon is there.
-
If it's not running, Visual Studio might not be able to launch your web app.
-
Try restarting Visual Studio or manually starting IIS Express.
2. Run Visual Studio as Administrator
Right-click on the Visual Studio icon and select "Run as Administrator".
-
This is important, especially if your app uses low-numbered ports (like 80) or needs special permissions.
3. Check the Project URL and Port
Go to your project settings:
-
Right-click your project > Properties > Web tab.
-
Look at the Project URL — make sure it’s valid (e.g.,
http://localhost:55800/
). -
If you're not sure, try changing the port to something else like
55800
.
4. Clear Cache and Config Files
Sometimes old files cause issues. Here's how to clean them:
-
Close Visual Studio.
-
Delete the
.vs
folder in your project folder. -
Go to this folder:
-
Find the file named
applicationhost.config
— back it up or delete it.
5. Check Your Firewall or Antivirus
Your firewall or antivirus might be blocking IIS Express or the port your app is using.
-
Make sure they’re not blocking localhost or IISExpress.exe.
6. Check the Hosts File
Go to this location:
Open the hosts
file in Notepad (as administrator), and make sure this line exists:
If it’s missing, add it.
7. Reinstall or Repair IIS Express
If IIS Express is broken or missing:
-
Go to Control Panel > Programs and uninstall IIS Express.
-
Download the latest version from the Microsoft Download Center and reinstall it.