How to turn on remote debugging for Visual Studio 2005 in Windows XP with Service Pack 2 (908099)
The information in this article applies to:
- Microsoft Visual Studio 2005 Standard Edition
- Microsoft Visual Studio 2005 Professional Edition
- Microsoft Visual Studio 2005 Express Edition
NoticeMicrosoft now provides a tool that will do most of the
required firewall configuration for you.
For more
information, click the following article number to view the article in the
Microsoft Knowledge Base: 841177
Description of the DebuggerFirewall utility that makes the Visual Studio Remote Debugger work through the Windows XP Service Pack 2 firewall
Important This article contains information about how to modify the
registry. Make sure to back up the registry before you modify it. Make sure
that you know how to restore the registry if a problem occurs. For more
information about how to back up, restore, and modify the registry, click the
following article number to view the article in the Microsoft Knowledge Base: 256986 Description of the Microsoft Windows registry SUMMARYThis article discusses how to turn on remote debugging for Microsoft Visual Studio 2005 in Microsoft Windows XP with Service Pack 2 (SP2). Windows Firewall replaces the Internet Connection Firewall (ICF) feature that is included in earlier versions of Windows XP.
To turn on remote debugging for Visual Studio 2005, you may have to change the configuration of Windows Firewall. You may also have to open ports, configure DCOM settings, turn on file and print sharing, and add applications to the exceptions list on both the computer that is running Visual Studio 2005 and the remote computer. INTRODUCTIONThe Windows Firewall feature in Windows XP SP2 includes
significant enhancements over the earlier the Internet Connection Firewall
(ICF) feature. These enhancements help protect the computer from attack by
malicious users or by malicious software such as viruses. By default, Windows
Firewall is turned on for all network connections including connections to the
Internet. Turn on remote debuggingTo turn on remote debugging in Windows XP with SP2, you must
configure Windows Firewall as follows:
- If Windows Firewall is in "shielded" mode, you must perform
the appropriate actions so that Windows Firewall is no longer in "shielded"
mode.
- If Windows Firewall is on, you must open some ports. You
must also grant some permissions to Microsoft Visual Studio 2005 and to other
executable programs that are used in remote debugging.
- If Windows Firewall is off, you may not have to configure a
firewall.
- Additionally, if the user who runs Microsoft Visual Studio
2005 does not have Administrator user rights on the remote computer, you must
configure the DCOM settings on the computer that is running Visual Studio
2005.
To turn on remote debugging, you must have Administrator user
rights on the computer that is running Visual Studio 2005. These instructions
are only for Internet Protocol version 4 (IPV4) based network settings. Configure DCOM on the computer that is running Visual Studio 2005Note After you make changes by using the DCOM Configuration tool
(Dcomcnfg.exe), you must restart the computer for the changes to take effect.
- At a command prompt, type dcomcnfg,
and then press ENTER. Component Services opens.
- In Component Services, expand Component
Services, expand Computers, and then expand
My Computer.
- On the toolbar, click Configure My
Computer. The My Computer dialog box
appears.
Note If you cannot click Configure My Computer, go to
the "Remove and then re-install the MSDTC
service" section. - In the
My Computer dialog box, click the COM
Security tab.
- Under Access Permission, click
Edit Limits. The Access Permission dialog box
appears.
- Under Group or user names, click
ANONYMOUS LOGON.
- Under Permissions for ANONYMOUS LOGON,
click to select the Remote Access check box, and then click
OK.
Remove and then re-install the MSDTC serviceIf you cannot click Configure My Computer that is
described in step 3 in the "Configure DCOM on the computer that is running
Visual Studio 2005" section, follow these steps. Warning Serious problems might occur if you modify the registry
incorrectly by using Registry Editor or by using another method. These problems
might require that you reinstall your operating system. Microsoft cannot
guarantee that these problems can be solved. Modify the registry at your own
risk. - Remove the Microsoft Distributed Transaction Service
(MSDTC):
- Click Start, click
Run, type cmd, and then click
OK.
- At the command prompt, run the following command to
stop the MSDTC service:
- At the command prompt, run the following command to
remove the MSDTC service: The command prompt will return without a
message.
- In Registry Editor, delete the
HKEY_LOCAL_MACHINE\Software\Microsoft\MSDTC
subkey.
- Re-install and then start the MSDTC service:
- At the command prompt, run the following command to
re-install the MSDTC service:
- At the command prompt, run the following command to
start the MSDTC service:
- Go to step 4 in
the "Configure DCOM on the computer that is running Visual Studio 2005"
section.
Configure the computer that is running Visual Studio 2005Open Windows Firewall To open Windows Firewall, click Start, click
Run, type firewall.cpl, and then click
OK. Open TCP port 135DCOM remote procedure call (RPC) uses Transfer Control Protocol
(TCP) port 135. If the application uses DCOM to communicate with remote
computers, port 135 must be open. To open TCP port 135, follow these
steps:
- In Windows Firewall, click Add Port on the
Exceptions tab. The Add a Port dialog box
appears.
- In the Name box, type TCP port
135.
- In the Port Number box, type
135.
- In the Protocol area, click
TCP.
- Click Change scope to open Change
Scope dialog box, click My network (subnet) only, and
then click OK. (This step is optional.)
- In the Add a Port dialog box, click
OK.
Open UDP port 4500User Datagram Protocol (UDP) port 4500 is used for Internet
Protocol security (IPsec). If your domain policy requires that all network
communication be completed through IPsec, this port must be open for any
network operation. If your domain policy does not require IPsec, go to the
" Turn on file and print sharing"
section. To open UDP port 4500, follow these steps:
- In Windows Firewall, click Add Port on the
Exceptions tab. The Add a Port dialog box
appears.
- In the Name box, type UDP port
4500.
- In the Port Number box, type
4500.
- In the Protocol area, click
UDP.
- Click Change scope. The Change
Scope dialog box appears. Click My network (subnet)
only, and then click OK. (This step is
optional.)
- In the Add a Port dialog box, click
OK.
Open UDP port 500UDP port 500 is used for IPsec. If your domain policy requires
that all network communication be completed through IPsec, this port must be
open for any network operation. If your domain policy does not require IPsec,
go to the " Turn on file and print
sharing" section. To open UDP port 500, follow these steps:
- In Windows Firewall, click Add Port on the
Exceptions tab. The Add a Port dialog box
appears.
- In the Name box, type UDP port
500.
- In the Port Number box, type
500.
- In the Protocol area, click
UDP.
- Click Change scope. The Change
Scope dialog box appears. Click My network (subnet)
only, and then click OK. (This step is
optional.)
- In the Add a Port dialog box, click
OK.
Turn on file and print sharing- In the Programs and Services area of the
Exceptions tab, click File and Print Sharing,
and then click Edit. The Edit a Service
dialog box appears.
- In the Edit a Service dialog box, click to
select the following check boxes:
- TCP 139
- TCP 445
- UDP 137
- UDP 138
- Click Change scope. The Change
Scope dialog box appears. Click My network (subnet)
only, and then click OK. (This step is
optional.)
- In the Change Scope dialog box, click
OK to save your settings.
- Click OK to close the Edit a
Service dialog box.
Add Devenv.exe to the application exceptions listTo enable applications that cannot run correctly unless the
required ports are opened dynamically at runtime, you must add the applications
to the application exceptions list. To add the Visual Studio 2005
Development Environment (Devenv.exe) to the application exceptions list, follow
these steps:
- In Windows Firewall, click Add Program on
the Exceptions tab. The Add a Program dialog
box appears.
- In the Add a Program dialog box, click
Browse. Locate Devenv.exe, and then click
OK.
Note The Devenv.exe file is typically located in the following folder:
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE Microsoft Visual Studio 2005 appears in the
Add a Program dialog box. - Click Change scope. The Change
Scope dialog box appears. Click My network (subnet)
only, and then click OK. (This step is
optional.)
- In the Add a Program dialog box, click
OK.
- In Windows Firewall, click OK to save your
settings.
Configure the remote computerAll the ports that you have opened on the debugger computer must
also be open on the remote computer. To open the TCP 135 port, the UDP 4500
port, and the UDP 500 port, and to turn on file and print sharing, follow the
steps in the " Configure the computer that is
running Visual Studio 2005" section. You must also add the
Msvsmon.exe file to the application exceptions list. Add MSVSMon.exe to the application exceptions list- In Windows Firewall, click Add Program on
the Exceptions tab. The Add a Program dialog
box appears.
- In the Add a Program dialog box, click
Browse. Locate Msvsmon.exe, and then click
OK.
Note Depending on the computer architecture, the Msvsmon.exe file may
be located in any one of the following folders:
- Drive:\Program
Files\Microsoft Visual Studio 8\Common7\IDE\Remote Debugger\x86
- Drive:\Program
Files\Microsoft Visual Studio 8\Common7\IDE\Remote Debugger\x64
- Drive:\Program
Files\Microsoft Visual Studio 8\Common7\IDE\Remote Debugger\ia64
Visual Studio 2005 Remote Debugger appears
in the Add a Program dialog box. - Click Change scope. The Change
Scope dialog box appears. Click My network (subnet)
only, and then click OK. (This step is
optional.)
- In the Add a Program dialog box, click
OK.
- In Windows Firewall, click OK to save your
settings.
Enable Web server debuggingHTTP uses TCP port 80. To do Web-based debugging, you must open
TCP port 80. This is true for Microsoft ASP.NET debugging, for classic ASP
debugging, and for ATL Server debugging. To open TCP port 80, follow
these steps:
- In Windows Firewall, click Add Port on the
Exceptions tab. The Add a Port dialog box
appears.
- In the Name box, type TCP port
80.
- In the Port Number box, type
80.
- In the Protocol area, click
TCP.
- Click Change scope. The Change
Scope dialog box appears. Click My network (subnet)
only, and then click OK. (This step is
optional.)
- In the Add a Port dialog box, click
OK.
- In Windows Firewall, click OK to save your
settings.
Enable script debuggingTo debug script code that runs on a remote computer, you must add
the process that hosts the script code to the application exceptions list.
Typically, in classic ASP debugging, the Dllhost.exe process or the Inetinfo.exe process hosts the script code. However, for a script that runs in
Microsoft Internet Explorer, the Iexplore.exe process or in the Explorer.exe process generally hosts the script code. To add the
process that hosts the script code to the application exceptions list, follow
these steps:
- Click Start, click Run,
type firewall.cpl, and then click
OK.
- In Windows Firewall, click Add Program on
the Exceptions tab. The Add a Program dialog
box appears.
- In the Add a Program dialog box, click
Browse. Locate the process that hosts the script code, and
then click OK. The application of the process that hosts the
script code appears in the Add a Program dialog
box.
For example, if you locate the iexplore.exe
process in this step, Internet Explorer appears in the
Add a Program dialog box. - In the Scope area, click My
network (subnet) only. (This step is optional.)
- In the Add a Program dialog box, click
OK.
- In Windows Firewall, click OK to save your
settings.
Run the debugger as a typical userIf you want to run the debugger as a typical user, you must have
full user rights to the folder where the executable files are located.
Additionally, if you do not have Administrator user rights on the remote
computer, you must have access permissions and start permissions to run the
debugger as a typical user. Note A typical user is a user who does not have Administrator user
rights. Note After you make changes by using the DCOM Configuration tool
(Dcomcnfg.exe), you must restart the computer for the changes to take
effect. To grant access permissions and start permissions, you must
have Administrator user rights. First, obtain Administrator user rights. Then,
follow these steps:
- At a command prompt, type dcomcnfg,
and then press ENTER. Component Services opens.
- In Component Services, expand Component
Services, expand Computers, and then expand
My Computer.
- On the toolbar, click Configure My
Computer. The My Computer dialog box
appears.
Note If you cannot click Configure My Computer, go to
the "Remove and then re-install the MSDTC
service" section. - In the
My Computer dialog box, click the COM
Security tab.
- Under Launch and Activate Permissions,
click Edit Limits.
- If your group or user name does not appear in the
Groups or user names list in the Launch
Permission dialog box, follow these steps:
- In the Launch Permission dialog box,
click Add.
- In the Select Users or Groups dialog
box, enter your user name and your group in the Enter the object names
to select box, and then click OK.
- In the Launch Permission dialog box,
select your user name and your group in the Group or user
names box.
- In the Allow column under
Permissions for User, select
Remote Activation, and then click OK.
Note User is a placeholder for the user name
or the group that is selected in the Group or user names box.
Repeat steps 7 and 8 for all the users and groups for which you want to grant
permissions.
Remove and then re-install the MSDTC serviceIf you cannot click Configure My Computer that is
described in step 3 in the "Run the debugger as a typical user" section, follow
these steps. Warning Serious problems might occur if you modify the registry
incorrectly by using Registry Editor or by using another method. These problems
might require that you reinstall your operating system. Microsoft cannot
guarantee that these problems can be solved. Modify the registry at your own
risk. - Remove the MSDTC service:
- Click Start, click
Run, type cmd, and then click
OK.
- At the command prompt, run the following command to
stop the MSDTC service:
- At the command prompt, run the following command to
remove the MSDTC service: The command prompt will return without a
message.
- In Registry Editor, delete the
HKEY_LOCAL_MACHINE\Software\Microsoft\MSDTC
subkey.
- Re-install and then start the MSDTC service:
- At the command prompt, run the following command to
re-install the MSDTC service:
- At the command prompt, run the following command to
start the MSDTC service:
- Go to step 4 in
the "Run the debugger as a typical user" section.
Modification Type: | Minor | Last Reviewed: | 4/11/2006 |
---|
Keywords: | kbinfo kbtshoot kbHOWTOmaster KB908099 kbAudITPRO kbAudDeveloper |
---|
|
|
©2004 Microsoft Corporation. All rights reserved.
|
|