You may receive an "unable to attach to the process" error message when you try to debug a remote script process

Symptoms

In Microsoft Visual Studio .NET or in Microsoft Visual Studio 2005, when you try to debug a remote script by attaching to the host DllHost.exe process that runs on a remote computer that is a member of the same domain, you may receive the following error message:
Unable to attach to the process. The process does not have sufficient privileges to be debugged.

Cause

You notice this behavior if the DllHost.exe process runs under a user account that does not have sufficient rights to debug the remote script. The DllHost.exe process does not have sufficient rights if both the following conditions are true:
  • The virtual directory that contains the remote script that you are trying to debug uses medium application protection or high application protection.
  • The DllHost.exe process does not run under a local administrator account or under a domain account.

    Note Typically, the DllHost.exe process runs under the IWAM_ComputerName user account. ComputerName is a placeholder for the name of the computer.
Microsoft has designed remote script debugging so that your computer has a higher level of protection.

Workaround

To work around this behavior, use either one of the following methods.

Note The following workarounds grant a high level of rights to some processes that run on your computer. These workarounds may also lower the level of protection for your computer. Therefore, Microsoft recommends that you use these workarounds only while you are debugging the remote script. When you have finished debugging the remote script, Microsoft recommends that you restore your computer to its original configuration.

Run the DllHost.exe process under a local administrator account or under a domain account

  1. On the remote computer:
    • On Microsoft Windows Server 2003
      Click Start, point to Administrative Tools, and then click Component Services.
    • On Microsoft Windows 2000
      Click
      Start, point to Programs, point to
      Administrative Tools, and then click Component Services.
  2. In the left pane of the Component Servicesdialog box, expand Component Services, expand
    Computers, expand My Computer, and then expand COM+ Applications.
  3. Right-click IIS Out-Of-Process Pooled Applications, and then click Properties. The
    IIS Out-Of-Process Pooled Applications Properties dialog box appears.
  4. Click the Identity tab. In the This user section, click Browse.
    • On Windows Server 2003
      The Select User dialog box appears.
    • On Windows 2000
      The Select User or Group dialog box appears.
  5. Do the following:
    • On Windows Server 2003
      In the Enter the object name to select box, type the name of a local administrator account or the name of a domain account, and then click OK to close the Select User or Group dialog box.
    • On Windows 2000
      Select a local administrator account or a domain account, and then click OK to close the Select User or Group dialog box.
  6. In the IIS Out-Of-Process Pooled Applications Properties dialog box, do the following:
    1. In the Password box, type the password of the user account that you selected in step 5.
    2. In the Confirm password box, type the password of the user account that you selected in steps 5.
    3. Click
      OK.

      Note If you receive a warning message, click
      Yes.
  7. Start a command prompt.
  8. At the command prompt, run the following command to reset Microsoft Internet Information Services (IIS):
    iisreset
  9. In Microsoft Internet Explorer, run the script that you want to debug.
  10. Attach to the host DllHost.exe process:
    1. On your local computer, start Visual Studio .NET or Visual Studio 2005.
    2. On the Tools menu, click Debug Processes. The Processes dialog box appears.
    3. Click the ellipsis button (...) next to the Name box. The Browse for Computer dialog box appears.
    4. In the Select machine box, locate and then select the remote computer, and then click OK.
    5. In the Processes dialog box, make sure that the Show system processes check box and the Show processes in all sessions check box are selected.
    6. In the Available Processes box, click the DllHost.exe process that has Microsoft Active Server Pages as a part of the Title field.
    7. Click Attach. The Attach to Process dialog box appears.
    8. In the Choose the program types that you want to debug box, make sure that the Script box is selected, and then click OK. You can now debug the remote script.
  11. To restore your computer to its original configuration after you finish debugging the remote script, follow these steps:
    1. Use the Adsutil.vbs script file to obtain the password for the IWAM_ComputerName user account on the remote computer.

      For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

      297989 PRB: Configured identity is incorrect for IWAM account

    2. Perform steps 1 through 4.
    3. Do the following:
      • On Windows Server 2003
        In the Select User dialog box, type
        IWAM_ComputerName in the
        Enter the object name to select box, and then click OK.
      • On Windows 2000
        In the Select User or Group dialog box, click
        IWAM_ComputerName, and then click
        OK.
    4. In the IIS Out-Of-Process Pooled Applications Properties dialog box, do the following:
      1. In the Password box, type the password that you obtained in step a.
      2. In the Confirm password box, type the password that you obtained in step a.
      3. Click
        OK.

        Note If you receive a warning message, click
        Yes.
    5. Perform steps 7 through 8.

Use low application protection for the virtual directory that contains the script that you want to debug

If you use low application protection for the virtual directory that contains the script that you want to debug, the script runs in the context of the Inetinfo.exe process. The Inetinfo.exe process runs under the SYSTEM user account. Therefore, you can debug the remote script. To use this workaround, follow these steps:
  1. On the remote computer:
    • On Windows Server 2003
      Click Start, point to Administrative Tools, and then click Internet Information Services (IIS) Manager. The Internet Information Services (IIS) Manager dialog box appears.
    • On Windows 2000
      Click Start, point to Programs, point to Administrative Tools, and then click Internet Services Manager. The Internet Services Managerdialog box appears.
  2. Do the following:
    • On Windows Server 2003
      In the left pane of the Internet Information Services (IIS) Manager dialog box, locate and then right-click the virtual directory that contains the script that you want to debug.
    • On Windows 2000
      In the left pane of the
      Internet Services Manager dialog box, locate and then right-click the virtual directory that contains the script that you want to debug.
  3. Click Properties.
  4. In the Application protection box of the
    Application settings section, select Low (IIS Process), and then click OK.
  5. In Internet Explorer, run the script that you want to debug.
  6. Attach to the host DllHost.exe process:
    1. On your local computer, start Visual Studio .NET or Visual Studio 2005.
    2. On the Tools menu, click Debug Processes. The Processes dialog box appears.
    3. Click the ellipsis button (...) next to the Name box. The Browse for Computer dialog box appears.
    4. In the Select machine box, locate and then select the remote computer, and then click OK.
    5. In the Processes dialog box, make sure that the Show system processes check box and the Show processes in all sessions check box are selected.
    6. In the Process field of the
      Available Processes box, click
      inetinfo.exe.
    7. Click Attach. The Attach to Process dialog box appears.
    8. In the Choose the program types that you want to debug box, make sure that the Script box is selected, and then click OK. You can now debug the remote script.
  7. To restore your computer to its original configuration after you have finished debugging the remote script, follow these steps:
    1. Perform steps 1 through 3.
    2. In the Application protection box of the Application settings section, select Medium (Pooled), and then click OK.

Status

This behavior is by design.

More Information

Steps to reproduce the behavior

  1. On the remote computer, run the script that you want to debug in Internet Explorer.
  2. On your local computer, start Visual Studio .NET or Visual Studio 2005.
  3. On the Tools menu, click Debug Processes. The Processes dialog box appears.
  4. Click the ellipsis button next to the Name box. The Browse for Computer dialog box appears.
  5. In the Select machine box, locate and then select the remote computer, and then click OK.
  6. In the Processes dialog box, make sure that the Show system processes check box and the Show processes in all sessions check box are selected.
  7. In the Available Processes box, click the DllHost.exe process that has Microsoft Active Server Pages as part of the Title field.
  8. Click Attach. The Attach to Process dialog box appears.
  9. In the Choose the program types that you want to debug box, make sure that the Script check box is selected, and then click OK.

References

For more information, visit the following Microsoft Developer Network (MSDN) Web sites:
How to enable remote debugging on Windows XP Service Pack 2http://msdn2.microsoft.com/en-us/library/ms997643.aspx
Propriedades

ID do Artigo: 833894 - Última Revisão: 13 de mai de 2008 - Revisão: 1

Comentários