From msdn:
ASP. NET debugging.
Note: If you cannot find the expected error message in this section, check the common debugging problem section or remote debugging problem section.
Message: Debugging cannot be started on the Web server.
Figure 1. Failed to start debugging error message
Cause 1: the IIS application is not configured to use Integrated Windows Authentication. Make sure that the Integrated Windows Authentication check box in the Authentication Method dialog box is selected, as shown in figure 2.
Figure 2. Enable integrated Authentication
Cause 2: Check the Enable HTTP Keep Alive option of IIS. If it is disabled, you may need to open it and try debugging again.
Message: You are not authorized to debug the server.
Figure 3. No debugging permission
Cause 1: Make sure that Integrated Windows Authentication is enabled. The possible cause is that Basic authentication is enabled only for IIS Directory Security.
Cause 2: If you are using Integrated Windows Authentication, make sure that your user account has full control over the IIS directory.
Cause 3: If you use a complete machine name (such as machinename. domainname. something) to create a Web project, the website will be recognized as an Internet site. Therefore, the default settings of Internet Explorer will affect logon behavior. In this case, you need to use the current account to enable logon in the "Internet" area with IE settings.
However, this is not the default setting for Internet Explorer, so it is best to use only the machine name to create a project and use figure 4 as the Security Settings guide.
Figure 4. Set Internet Explorer Authentication
Message: A server error occurs when an HTTP request is sent and debugged.
Figure 5. Server errors during debugging
Cause 1: The Web application does not have an application name. Therefore, use iis mmc to check the properties of the Web project and ensure that the Web project has an application name. The Application name should appear when the red profile in Figure 6 appears.
Figure 6. Set the application name
Cause 2: If the NTFS file format is used, make sure that "aspnet" has the "wwwroot" or the appropriate permissions on the virtual directory folder to access and write these folders.