Microsoft KB Archive/833894

= You may receive an &quot;unable to attach to the process&quot; error message when you try to debug a remote script process =

Article ID: 833894

Article Last Modified on 4/29/2007

-

APPLIES TO


 * Microsoft Visual Studio 2005 Professional Edition
 * Microsoft Visual Studio 2005 Standard Edition
 * Microsoft Visual Studio .NET 2003 Enterprise Architect
 * Microsoft Visual Studio .NET 2003 Enterprise Developer
 * Microsoft Visual Studio .NET 2003 Academic Edition
 * Microsoft Visual Studio .NET 2002 Professional Edition
 * Microsoft Visual Studio .NET 2002 Enterprise Architect
 * Microsoft Visual Studio .NET 2002 Enterprise Developer
 * Microsoft Visual Studio .NET 2002 Academic Edition

-





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_ user account. 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
 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.  In the left pane of the Component Services dialog box, expand Component Services, expand Computers, expand My Computer, and then expand COM+ Applications. Right-click IIS Out-Of-Process Pooled Applications, and then click Properties. The IIS Out-Of-Process Pooled Applications Properties dialog box appears.</li> Click the Identity tab. In the This user section, click Browse.  On Windows Server 2003

The Select User dialog box appears.</li> On Windows 2000

The Select User or Group dialog box appears.</li></ul> </li> 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.</li> 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.</li></ul> </li> In the IIS Out-Of-Process Pooled Applications Properties dialog box, do the following: <ol style="list-style-type: lower-alpha;"> In the Password box, type the password of the user account that you selected in step 5.</li> In the Confirm password box, type the password of the user account that you selected in steps 5.</li> Click OK.

Note If you receive a warning message, click Yes.</li></ol> </li> Start a command prompt.</li> At the command prompt, run the following command to reset Microsoft Internet Information Services (IIS):

iisreset

</li> In Microsoft Internet Explorer, run the script that you want to debug.</li> Attach to the host DllHost.exe process: <ol style="list-style-type: lower-alpha;"> <li>On your local computer, start Visual Studio .NET or Visual Studio 2005.</li> <li>On the Tools menu, click Debug Processes. The Processes dialog box appears.</li> <li>Click the ellipsis button (...) next to the Name box. The Browse for Computer dialog box appears.</li> <li>In the Select machine box, locate and then select the remote computer, and then click OK.</li> <li>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.</li> <li>In the Available Processes box, click the DllHost.exe process that has Microsoft Active Server Pages as a part of the Title field.</li> <li>Click Attach. The Attach to Process dialog box appears.</li> <li>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.</li></ol> </li> <li>To restore your computer to its original configuration after you finish debugging the remote script, follow these steps: <ol style="list-style-type: lower-alpha;"> <li>Use the Adsutil.vbs script file to obtain the password for the IWAM_ 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

</li> <li>Perform steps 1 through 4.</li> <li>Do the following: <ul> <li>On Windows Server 2003

In the Select User dialog box, type IWAM_ in the Enter the object name to select box, and then click OK.</li> <li>On Windows 2000

In the Select User or Group dialog box, click IWAM_ , and then click OK.</li></ul> </li> <li>In the IIS Out-Of-Process Pooled Applications Properties dialog box, do the following: <ol> <li>In the Password box, type the password that you obtained in step a.</li> <li>In the Confirm password box, type the password that you obtained in step a.</li> <li>Click OK.

Note If you receive a warning message, click Yes.</li></ol> </li> <li>Perform steps 7 through 8.</li></ol> </li></ol>

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: <ol> <li>On the remote computer: <ul> <li>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.</li> <li>On Windows 2000

Click Start, point to Programs, point to Administrative Tools, and then click Internet Services Manager. The Internet Services Manager dialog box appears.</li></ul> </li> <li>Do the following: <ul> <li>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.</li> <li>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.</li></ul> </li> <li>Click Properties.</li> <li>In the Application protection box of the Application settings section, select Low (IIS Process), and then click OK.</li> <li>In Internet Explorer, run the script that you want to debug.</li> <li>Attach to the host DllHost.exe process: <ol style="list-style-type: lower-alpha;"> <li>On your local computer, start Visual Studio .NET or Visual Studio 2005.</li> <li>On the Tools menu, click Debug Processes. The Processes dialog box appears.</li> <li>Click the ellipsis button (...) next to the Name box. The Browse for Computer dialog box appears.</li> <li>In the Select machine box, locate and then select the remote computer, and then click OK.</li> <li>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.</li> <li>In the Process field of the Available Processes box, click inetinfo.exe.</li> <li>Click Attach. The Attach to Process dialog box appears.</li> <li>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.</li></ol> </li> <li>To restore your computer to its original configuration after you have finished debugging the remote script, follow these steps: <ol style="list-style-type: lower-alpha;"> <li>Perform steps 1 through 3.</li> <li>In the Application protection box of the Application settings section, select Medium (Pooled), and then click OK.</li></ol> </li></ol>

<div class="status_section">

STATUS
This behavior is by design.

<div class="moreinformation_section">

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.

<div class="references_section">