C#

ASPNET 5 MVC unable to connect to web server IIS Express

25 September 2026 · 7 min read

ASPNET 5 MVC unable to connect to web server IIS Express

Wrestling with the dreaded “Unable to connect to web server ‘IIS Express’” error in your ASP.NET 5 MVC application? This frustrating issue can bring your development workflow to a screeching halt. Understanding the root causes and implementing effective solutions is crucial for any ASP.NET developer. This guide delves into common reasons behind this connectivity problem, providing practical troubleshooting steps and preventative measures to keep your development process smooth and efficient. We’ll explore everything from port conflicts and incorrect configurations to firewall interference and application pool issues, equipping you with the knowledge to tackle this error head-on.

Port Conflicts: A Common Culprit

One of the most frequent reasons for encountering the “Unable to connect to web server ‘IIS Express’” error is a port conflict. This occurs when another application is already using the port assigned to your ASP.NET application. IIS Express typically uses ports in the 44300-44399 range, but conflicts can arise if another process occupies these ports. Identifying and resolving these conflicts is a crucial first step.

Tools like netstat -ano can be used in the command prompt to pinpoint which processes are bound to specific ports. Once identified, you can either stop the conflicting process or reconfigure your ASP.NET application to use a different port within the launchSettings.json file. This file, located in the Properties folder of your project, allows you to specify the application URL and port settings.

For example, you might change the applicationUrl property to "https://localhost:44305" to use a different port. Remember to restart your application after making these changes.

Incorrect Configuration in applicationhost.config

Another source of connection problems lies within the applicationhost.config file. This file, which holds IIS Express configuration details, can sometimes contain incorrect settings that prevent proper communication. Specifically, issues with the site bindings, virtual directories, or application pool settings can contribute to the error.

Locating the applicationhost.config file can be tricky as its location can vary. One common location is within the .vs folder hidden within your solution directory. You may need to reveal hidden folders to access it. Inspecting this file for inconsistencies in the site bindings, ensuring they match your project settings, can often resolve connection problems. Additionally, verifying the correct application pool configuration for your site is essential.

A common mistake is a mismatch between the .NET framework version of your application and the application pool. Ensure the application pool is configured for the correct .NET version.

Firewall Interference

Firewalls, while crucial for security, can sometimes block IIS Express from accepting incoming connections. This blockage can manifest as the “Unable to connect” error. To troubleshoot this, temporarily disable your firewall or add an exception for IIS Express and your application’s port. If this resolves the issue, you’ll need to configure a permanent firewall rule to allow IIS Express to communicate without hindrance.

Be sure to only open the necessary ports and avoid completely disabling your firewall for extended periods. This practice ensures your system remains protected while allowing your development environment to function correctly.

Remember to consider both Windows Firewall and any third-party firewall software you may have installed.

Application Pool Issues

The application pool associated with your ASP.NET application in IIS Express can also cause connection problems. If the application pool is stopped or encounters errors, it will prevent the web server from functioning properly. Checking the status of the application pool and restarting it if necessary can often resolve these issues.

You can manage application pools through the IIS Express system tray icon. Right-click the icon and select “Show All Applications” to view and manage the application pools associated with your projects.

Additionally, ensure the application pool’s identity has the necessary permissions to access your application’s files and directories.

  • Verify that no other applications are using the same port as your ASP.NET application.
  • Double-check the site bindings and application pool configuration in applicationhost.config.
  1. Check the launchSettings.json file for correct port configuration.
  2. Inspect the applicationhost.config file for site bindings and application pool settings.
  3. Temporarily disable your firewall or add an exception for IIS Express.
  4. Check the status and configuration of your application pool.

“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” - Brian Kernighan

Infographic Placeholder: Visualizing common causes and solutions for IIS Express connection errors.

Learn more about troubleshooting common ASP.NET errors.For further reading on IIS Express configuration, refer to the official Microsoft documentation: IIS Documentation. You can also find helpful troubleshooting tips on Stack Overflow: Stack Overflow. For deeper insights into ASP.NET Core, consider exploring the official ASP.NET website.

Featured Snippet Optimized: To quickly check for port conflicts, open your command prompt and type netstat -ano. This command will display a list of active connections and the processes using them. Locate the port your ASP.NET application is using and identify the corresponding process ID (PID). If another process is using the same port, you’ve identified a conflict.

FAQ: Frequently Asked Questions about IIS Express Connectivity

  • Q: How do I change the port IIS Express uses?
    A: Modify the applicationUrl property within the launchSettings.json file located in the Properties folder of your project. Restart your application for the changes to take effect.
  • Q: Where can I find the applicationhost.config file?
    A: This file is often located in a hidden .vs folder within your solution directory. Enable viewing hidden files and folders to locate it.

By addressing these common causes of the “Unable to connect to web server ‘IIS Express’” error, you can regain control of your ASP.NET development process. Understanding port conflicts, configuration files, firewall settings, and application pool management empowers you to troubleshoot effectively and prevent future occurrences. Remember to systematically check each potential issue and implement the appropriate solutions. This methodical approach will save you valuable time and frustration, allowing you to focus on building robust and efficient web applications.

Ready to dive deeper into ASP.NET development? Explore our resources on advanced topics like middleware, dependency injection, and building RESTful APIs. Don’t let connectivity issues hold you back – master the intricacies of ASP.NET and unlock your full development potential.

Question & Answer :
What I’m doing:

Deleting applicationhost.config, located in Documents\IISExpress\config, doesn’t change the error message. (There’s also an IISExpress folder in program files and program files (x86).)

Something I noticed, and I don’t know if it’s a problem:

Referenced file ’lib/jquery-validation/jquery.validate.js’ not found.

I got a dump with rawcap but I don’t notice much in there. Some of what was there:

“Framework”:{“FrameworkName”:“DNXCore,Version=v5.0”,“FriendlyName”:“DNX Core 5.0”,“ShortName”:“dnxcore50”,“RedistListPath”:null}

I don’t notice a problem, but I have the network data if that can help figure out why I cannot connect to the web server. I get a RST,ACK immediately so I’m guessing the port is closed and whatever this web server is, isn’t being setup.

More on this problem: 800700c1 error from /trace:error

I’ve tried:

  • deleting applicationhost.config (and changing port number)
  • running visual studio as administrator
  • deleting IISExpress folder in Documents (changes error message until the folder is reinstalled)
  • toggling ssl off and on, copying url to launch box. (note: I’m not using ssl)
  • clearing all sfc /scannow errors
  • starting iisexpress with x86 version and 64-bit version

After installing Update 2 for Visual Studio 2015 I started getting the same error. I tried everything above with no luck. However, I found a solution that works for me:

  1. Delete YourSolutionFolder\\.vs\config\applicationhost.config file (note: .vs is a hidden folder)
  2. Open Visual Studio, right-click on web site > Properties > Debug tab > Web Server Settings > App URL - change port number.

If you have IIS configured to use the same port, (stop the application / use different port) and try again.