Andrew Connell

Fix VS .NET debugger when unable to debug by manually attaching to a process

The following steps helps me resolve a nasty VS.NET debugging issue I was having. When you launch the VS .NET debugger automatically by pressing the PLAY button or F5, debugging works just fine. However, if you try to manually attach to a process (like w3wp.exe in Windows Server 2003), the debugger is never able to load the debug symbols and it won''t stop on your breakpoints.

The following steps helps me resolve a nasty VS.NET debugging issue I was having. When you launch the VS .NET debugger automatically by pressing the PLAY button or F5, debugging works just fine. However, if you try to manually attach to a process (like w3wp.exe in Windows Server 2003), the debugger is never able to load the debug symbols and it won’t stop on your breakpoints. I finally threw in the towel and used one of my MSDN Universal subscription PSS tickets to resole this issue:

Go to Start -> Run -> Type dcomcnfg and press Enter .

  1. On the Default Properties Tab
    1. Make sure that Enable Distributed COM on this computer is checked
    2. Set default authorization level to Connect
    3. Set default impersonation level to Identify
  2. On the Default Security Tab
    1. Edit Default for the Default Access Permissions
    2. Add the following accounts if they are not present
      1. MachineName\Administrators
      2. MachineName\Debugger Users
      3. System
    3. Edit Default for the Default Launch Permissions
    4. Add the following accounts if they are not present
      1. MachineName\Administrators
      2. MachineName\Debugger Users
      3. System
  3. On the Applications Tab, locate and select the Just-In-Time Debugging Handler and CLR Remote Host application
    1. On the General Tab, make sure that the Authentication level is set to connect
    2. On the Security Tab, select Use Custom access permissions and select the Edit button
    3. Add the following accounts if they are not present
      1. MachineName\Administrators
      2. MachineName\Debugger Users
      3. System
    4. On the Security Tab, select Use Custom launch permissions and select the Edit button
    5. Add the following accounts if they are not present
      1. MachineName\Administrators
      2. MachineName\Debugger Users
      3. System
    6. On the Identity Tab, make sure that the interactive user is selected
    7. Click OK until you are back to the Distributed COM Configuration Properties dialog.
  4. On the Applications Tab, locate and select the Machine Debug Manager application
    1. On the General Tab, make sure that the Authentication level is set to connect
    2. On the Security Tab, select Use Custom access permissions and select the Edit button
    3. Add the following accounts if they are not present
      1. MachineName\Administrators
      2. MachineName\Debugger Users
      3. System
    4. On the Security Tab, select Use Custom launch permissions and select the Edit button
    5. Add the following accounts if they are not present
      1. MachineName\Administrators
      2. MachineName\Debugger Users
      3. System
    6. On the Identity Tab, make sure that The System Account (services only) is selected
    7. Click OK until you are back to the Distributed COM Configuration Properties dialog.

Local Security Policy Settings

  1. Open the Local Security Policy Settings from Control Panel -> Administrative Tools -> Local Security Policy
  2. From the right-hand side select expand Local Policies
  3. Select User Rights Assignments
  4. Double click the Debug Programs privilege and add the Debugger Users group

Give rights on the following folders

  1. C:\WINNT\Temp\Developers group -> Full control

  2. C:\WINNT\Microsoft.NET\Framework\v1.1.4322\CONFIG\Developers group -> Read&Execute, List Folder Contents, Read

  3. C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\Developers group -> Full control

  4. C:\Inetpub\Developers group -> Read&Execute, List Folder Contents, Read (added)

  5. C:\Inetpub\wwwroot\Developers group -> Full control

  6. C:\Inetpub\wwwroot\Developers group -> Read&Execute, List Folder Contents, Read (added)

  7. Open the machine.config file from the C:\WINNT\Microsoft.NET\Framework\v1.1.4322\CONFIG folder

  8. Press CTRL + F to open the Find dialog and type

  9. Change the userName attribute to be the user

  10. Change the password attribute to be the users password.

Andrew Connell
Founder & Chief Course Artisan, Voitanos LLC. | Microsoft MVP
Written by Andrew Connell

Andrew Connell is a web developer with a focus on Microsoft Azure & Microsoft 365. He’s received Microsoft’s MVP award every year since 2005 and has helped thousands of developers through the various courses he’s authored & taught. Andrew’s the founder of Voitanos and is dedicated to delivering industry-leading on-demand video training to professional developers. He lives with his wife & two kids in Florida.