Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
When you try to debug an ASP.NET application running on a Web server, you may get this error message: Unable to start debugging on the Web server
.
Often, this error occurs because an error or configuration change has occurred that requires an update to your Application Pools, an IIS reset, or both. You can reset IIS by opening an elevated command prompt and typing iisreset
.
The Unable to start debugging on the Web server
message is generic. Usually, a more specific message is included in the error string and that may help you identify the cause of the problem or search for a more exact fix. Here are a few of the more common error messages that are appended to the main error message:
Restart Visual Studio as an Administrator and retry debugging. (Some ASP.NET debugging scenarios require elevated privileges.)
You can configure Visual Studio to always run as an Administrator by right-clicking the Visual Studio shortcut icon, choosing Properties > Advanced, and then choosing to always run as an Administrator.
Are you running Visual Studio and the Web server on the same machine and debugging using F5 (instead of Attach to Process)? Open your project properties and make sure that the project is configured to connect to the correct Web server and launch URL. (Open Properties > Web > Servers or Properties > Debug depending on your project type. For a Web Forms project, open Property Pages > Start Options > Server.)
Otherwise, restart your Application Pool and then reset IIS. For more information, see Check your IIS Configuration.
Check your IIS log file for error subcodes and additional information, and this IIS 7 blog post.
In addition, here are some of the common error codes and a few suggestions.
web.config
file includes debug=true
in the compilation element. Make sure that your Web Application folder has the right permissions and that your Application Pool configuration is correct (a password may have changed). See Check your IIS Configuration. If these settings are already correct and you are debugging locally, also verify that you are connecting to the correct server type and URL (in Properties > Web > Servers or Properties > Debug, depending on your project type).web.config
file with no URL rewrites. See the Note about the URL Rewrite Module in Check your IIS Configuration.If you are debugging locally, open your project properties in Visual Studio and make sure that the project is configured to connect to the correct Web server and URL. (Open Properties > Web > Servers or Properties > Debug depending on your project type.)
This error may occur when debugging locally with a 32-bit version of Visual Studio, which use the 64-bit version of the remote debugger to debug 64-bit applications. Visual Studio 2019 and earlier are 32-bit applications. Check your App Pool on IIS to make sure that Enable 32-bit applications is set to true
, restart IIS, and try again.
Also, if you are using a HOSTS file, make sure it is configured correctly. For example, the HOSTS file needs to include the same project URL as in your project properties, Properties > Web > Servers or Properties > Debug, depending on your project type.
Are you running Visual Studio and the Web server on the same machine? Open your project properties and make sure that the project is configured to connect to the correct Web server and launch URL. (Open Properties > Web > Servers or Properties > Debug depending on your project type.)
If that does not work or you are debugging remotely, follow steps in Check your IIS Configuration.
If you are doing URL rewrites, test a basic web.config
file with no URL rewrites. See the Note about the URL Rewrite Module in Check your IIS Configuration.
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 elevated command prompt and typing iisreset
.
Stop and restart your IIS Application Pools, then retry.
The Application Pool may have stopped as a result of an error. Or, another configuration change that you made may require that you stop and restart your Application Pool.
Note
If the Application Pool keeps stopping, you may need to uninstall the URL Rewrite Module from the Control Panel, and then reinstall the module. This issue may occur after a significant system upgrade.
Check your Application Pool configuration, correct it if needed, and then retry.
The Application Pool may be configured for a version of ASP.NET that does not match your Visual Studio project. Update the ASP.NET version in the Application Pool and restart it. For detailed information, see IIS 8.0 Using ASP.NET 3.5 and ASP.NET 4.5.
Also, if password credentials have changed, you may need to update them in your Application Pool or Web site. In the Application Pool, update credentials in Advanced Settings > Process Model > Identity. For the Web site, update credentials in Basic Settings > Connect as.... Restart your Application Pool.
Check that your Web Application folder has the right permissions.
Make sure that you give IIS_IUSRS, IUSR, or the specific user associated with the Application Pool read and execute rights for the Web Application folder. Fix the issue and restart your Application Pool.
Make sure that the correct version of ASP.NET is installed on IIS.
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.
Resolve authentication errors if you are using only the IP address
By default, IP addresses are assumed to be part of the Internet, and NTLM authentication is not done over the Internet. If your web site is configured in IIS to require authentication, this authentication fails. To correct this problem, you can specify the name of the remote computer instead of the IP address.
If the IIS configuration is not causing the issue, try these steps:
Restart Visual Studio with Administrator privileges and try again.
Some ASP.NET debugging scenarios require elevated privileges for Visual Studio.
If multiple instances of Visual Studio are running, reopen your project in one instance of Visual Studio (with Administrator privileges), and try again.
If you are using a HOSTS file with local addresses, try using the loopback address instead of the machine's IP address.
If you are not using local addresses, make sure your HOSTS file includes the same project URL as in your project properties, Properties > Web > Servers or Properties > Debug, depending on your project type.
Bring up the localhost
page in the browser on the server.
If IIS is not installed correctly, you should get errors when you type http://localhost
in a browser.
For more information on deploying to IIS, see IIS 8.0 Using ASP.NET 3.5 and ASP.NET 4.5 and, for ASP.NET Core, Host on Windows with IIS.
Create a basic ASP.NET application on the server (or use a basic web.config
file).
If you can't get your app to work with the debugger, try creating a basic ASP.NET application locally on the server, and try to debug the basic app. (You might want to use the default ASP.NET MVC template.) If you can debug a basic app, that may help you identify what's different between the two configurations. Look for differences in settings in the web.config
file, such as URL rewrite rules.
Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register today