Edit

Share via


Error: The web server is not configured correctly

After taking steps detailed here to resolve the issue, and before trying again to debug, you may also need to reset IIS. You can do that by opening an Administrator command prompt and typing iisreset.

Take these steps to resolve this issue:

  1. If the web app hosted on the server is configured as a Release build, republish as a Debug build, and verify that the web.config file contains debug=true in the compilation element. Reset IIS and retry.

    For example, if you are using a Publish Profile for a Release build, change it to Debug and republish. Otherwise, the debug attribute will be set to false when you publish.

  2. (IIS) Verify that the physical path is correct. In IIS, you find this setting in Basic Settings > Physical Path (or Advanced Settings in older versions of IIS).

    The physical path may be incorrect if the web application was copied to a different machine, manually renamed, or moved. Reset IIS and retry.

  3. If you are debugging locally in Visual Studio, verify that the correct server is selected in the properties. (Open Properties > Web > Servers or Properties > Debug depending on your project type. For a Web Forms project, open Property Pages > Start Options > Server).

    If you are using an external (custom) server such as IIS, the URL must be correct. Otherwise, select IIS Express and retry.

  4. (IIS) Make sure that the correct version of ASP.NET is installed on the server.

    Mismatched versions of ASP.NET on IIS and in your Visual Studio project may cause this issue. You may need to set the framework version in web.config. To install ASP.NET Core on IIS, see Install ASP.NET Core on Windows Server or, for ASP.NET, Install ASP.NET on Windows Server. Also, see IIS 8.0 Using ASP.NET 3.5 and ASP.NET 4.5 or, for ASP.NET Core, Host on Windows with IIS.

  5. If the maxConnection limit in IIS is too low, and you have too many connections, you may need to increase the connection limit.

See also