Error message when you try to attach the Visual Studio 2005 debugger to a process: "Unable to attach to the process. Access is denied"

Article translations Article translations
Article ID: 907290 - View products that this article applies to.
Important This article contains information that shows you how to help lower security settings or how to turn off security features on a computer. You can make these changes to work around a specific problem. Before you make these changes, we recommend that you evaluate the risks that are associated with implementing this workaround in your particular environment. If you implement this workaround, take any appropriate additional steps to help protect your system.
Expand all | Collapse all

On This Page

SYMPTOMS

When you try to attach the Microsoft Visual Studio 2005 debugger to a process, you receive the following error message:
Unable to attach to the process. Access is denied.
Note This behavior does not occur when you are using an administrator account.

CAUSE

This behavior occurs when the process that you are trying to debug is running under a different user account. Microsoft Windows prevents the Visual Studio 2005 debugger from attaching to a process that is running under a different user account.

WORKAROUND

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

Method 1. Use an administrator account

Log on to the computer as a user who has administrative credentials. Then try to attach the Visual Studio 2005 debugger to the process.

Method 2. Enable users to attach the debugger to a process that is running under a different user account

Warning This workaround may make your computer or your network more vulnerable to attack by malicious users or by malicious software such as viruses. We do not recommend this workaround but are providing this information so that you can implement this workaround at your own discretion. Use this workaround at your own risk.

Configure Windows to enable users who are not administrators to attach the Visual Studio 2005 debugger to a process that is running under a different user account.

Warning Because of the security risks involved, we recommend that you do not give users permission to attach to a process that is running under a different user account. A user who is granted permission to attach to a process that is running under a different user account can gain control of the computer.

Note This workaround grants the SeDebugPrivilege user right to the debugger user.

To enable users who are not administrators to attach the Visual Studio 2005 debugger to a process that is running under a different user account, follow these steps:
  1. Log on to the computer as a user who has administrative credentials.
  2. Click Start, click Run, type Control admintools, and then click OK.
  3. Double-click Local Security Policy.
  4. In the Local Security Settings dialog box, click Local Policies, double-click User Rights Assignment, and then double-click Debug programs.
  5. In the Debug programs Properties dialog box, click Add User or Group.
  6. In the Select User or Groups dialog box, type the name of the user or group for whom you want to grant permissions, and then click OK two times.
  7. On the File menu, click Exit to close the Local Security Settings dialog box.

STATUS

This behavior is by design.

MORE INFORMATION

For more information about how to use the SeDebugPrivilege user right with Microsoft Visual C++, click the following article number to view the article in the Microsoft Knowledge Base:
131065 How to obtain a handle to any process with SeDebugPrivilege
For more information about how to use the SeDebugPrivilege user right with Microsoft Visual Basic, click the following article number to view the article in the Microsoft Knowledge Base:
185215 How to use the SeDebugPrivilege to acquire any process handle

Properties

Article ID: 907290 - Last Review: July 10, 2006 - Revision: 2.0
APPLIES TO
  • Microsoft Visual Studio 2005 Standard Edition
  • Microsoft Visual Studio 2005 Professional Edition
  • Microsoft Visual Studio 2005 Express Edition
  • Microsoft Visual Studio 2005 Team System Architect Edition
  • Microsoft Visual Studio 2005 Team System Developer Edition
  • Microsoft Visual Studio 2005 Team System Test Edition
  • Microsoft Visual Studio 2005 Team Foundation
  • Microsoft Visual Studio 2005 Tools for the Microsoft Office System
Keywords: 
kbtshoot kbprb KB907290

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com