How to: Manually Configure the Windows Vista Firewall for Remote Debugging
This topic applies to:
Edition |
Visual Basic |
C# |
F# |
C++ |
Web Developer |
---|---|---|---|---|---|
Express |
![]() |
![]() |
![]() |
![]() |
![]() |
Pro, Premium, and Ultimate |
![]() |
![]() |
![]() |
![]() |
![]() |
On Windows Vista platforms, remote debugging setup requires some additional steps to configure the Windows Firewall. These steps are performed automatically when you run the remote debugger for the first time. If manual setup is needed for any reason, follow the procedures in this section.
If the Windows Firewall is off, no firewall configuration is necessary.
If the Windows Firewall is on, some ports must be opened and permissions must be granted to Visual Studio and other executables involved in the remote debugging. The Windows Firewall must not be in Shielded mode.
Upozornění
Configuring the Windows Firewall to allow remote debugging could allow other users to gain remote access. You can restrict this remote access to computers on your local subnet, which will limit the security risk.
To configure the Visual Studio host computer
In Control Panel,click Classic View.
Double-click Security Center.
In Windows Security Center, click Windows Firewall.
In the Windows Firewall window, click Change Settings.
The User Account Control dialog box appears.
If the User Account Control dialog box requests your permission to continue, click Continue.
If the User Account Control dialog box requests your Administrator password, type your password and click Submit.
The Windows Firewall Settings dialog box appears.
Steps 6-9 open TCP port 135 (used by DCOM to communicate with remote computers).
On the Exceptions tab, click the Add a Port button.
In the Add Port dialog box, do the following:
For Name, type a description (such as remote debugging DCOM).
For Port Number, type 135.
Select TCP.
(Optional) Limiting access to computers on your local subnet enhances security. You should do this unless you have to debug outside the local subnet.
Click Change Scope.
In the Change Scope dialog box, select My network (subnet) only.
Click OK.
Click OK to close the Add a Port dialog box.
If your domain policy requires network communication to be done through IPSec, do this step. Otherwise, skip it.
Open UDP port 4500 (used for IP security) by repeating the prior step, substituting UDP for the Protocol, and 4500 for the Port Number.
Open UDP port 500 (used for IP security) the same way, substituting UDP for the Protocol, and 500 for the Port Number.
Steps 11-16 add Devenv.exe (the Microsoft Visual Studio development environment) to the SP2 application security Exception list so that it can dynamically open ports at runtime.
Click Add a program.
In the Add program dialog box, click the Browse button.
In the Browse dialog box, navigate to where devenv.exe is located (typically SystemDrive:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE). Select devenv.exe.
Click OK to close the Browse dialog box.
(Optional) Limiting access to computers on your local subnet enhances security. You should do this unless you have to debug outside the local subnet.
Click Change Scope.
In the Change Scope dialog box, select My network (subnet) only.
Click OK.
Click OK to close the Add a program dialog box.
To configure the remote computer
In Control Panel, click Classic View.
Double-click Security Center.
In Windows Security Center, click Windows Firewall.
In the Windows Firewall window, click Change Settings.
The User Account Control dialog box appears.
If the User Account Control dialog box requests your permission to continue, click Continue.
If the User Account Control dialog box requests your Administrator password, type your password and click Submit.
Steps 6-9 open the TCP 135 port, which is used by DCOM to communicate with remote computers.
On the Exceptions tab, click the Add Port button.
In the Add Port dialog box, do the following:
For Port Number, type 135.
For Description, type a description (such as remote debugging DCOM).
Select TCP.
(Optional) Limiting access to computers on your local subnet enhances security. You should do this unless you have to debug outside the local subnet:
Click Change Scope.
In the Change Scope dialog box, select My network (subnet) only.
Click OK.
Click OK to close the Add Port dialog box.
If your domain policy requires network communication to be performed through IPSec, do this step. Otherwise, skip it:
Open UDP port 4500 (used for IP security) by repeating the prior step, substituting UDP for the Protocol and 4500 for the Port Number.
Open UDP port 500 (used for IP security) the same way, substituting UDP for the Protocol, and 500 for the Port Number.
Follow steps 10–16 to add msvsmon to the SP2 Exception list. This enables it to dynamically open ports at run time.
Click the Add a Program button.
In the Add a Program dialog box, click the Browse button.
In the Browse dialog box, locate Msvsmon.exe, which will be in one of the following directories:
Install path \Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger\x86
Install path \Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger\x64
Install path \Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger\ia64
(Optional) By limiting access to computers on your local subnet, you enhance security. You should do this unless you have to debug outside the local subnet.
Click Change Scope.
In the Change Scope dialog box, select My network (subnet) only.
Click OK.
Click OK to close the Add a program dialog box.
Click OK to close Windows Firewall.
Close the Windows Security Center.
Steps 17–22 open ports that are required for file and print sharing.
In Control Panel, double-click Administrative Tools.
In Administrative Tools, double-click Windows Firewall with Advanced Security.
If the User Account Control dialog box appears, click Yes to continue.
The Windows Firewall with Advanced Security application appears.
Add an exception for TCP 135, which is the port that is used by DCOM to communicate with the remote computer.
Click Inbound Rules.
In the Actions pane, click New Rule.
The New Inbound Rule Wizard appears.
Under What type of rule would you like to create?, select Port, and then click Next.
Select TCP and Specific local ports, and then enter 135 in the Specific local ports box.
Click Next.
On the Action page, select Allow the Connection, and then click Next.
On the Profile page, select the profiles where you want the rule to apply. Usually, you will want Domain and possibly Private, but not Public.
Click Next.
On the Name page, type a meaningful name in the name box, such as Remote Debugging DCOM.
Click Finish.
If your domain policy requires network communication to occur through IPSec, follow this step. Otherwise, see step 5.
Click New Rule.
The New Inbound Rule Wizard appears.
Under What type of rule would you like to create?, select Port, and then click Next.
Select UDP and Specific local ports, and then enter 4500 and 500 in the Specific local ports box.
Click Next.
On the Action page, select Allow the Connection, and then click Next.
On the Profile page, select the same profiles that you selected in step 3.
Click Next.
On the Name page, type a name in the name box, such as Remote Debugging DCOM UDP.
Click Finish.
Add exceptions for TCP 139, TCP 445, UDP 137, and UDP 138, which are the ports that are used by DCOM to communicate with the remote computer.
Click New Rule.
The New Inbound Rule Wizard appears.
Under What type of rule would you like to create?, select Port, and then click Next.
Select TCP and Specific local ports, and then enter 139, 445 in the Specific local ports box.
Click Next.
On the Action page, select Allow the Connection, and then click Next.
On the Profile page, select the same profiles that you selected in step 3.
Click Next.
On the Name page, type a name in the name box, such as Remote Debugging File and Printer Sharing TCP.
Click Finish.
Click New Rule again.
The New Inbound Rule Wizard appears.
Under What type of rule would you like to create?, select Port, and then click Next.
Select UDP and Specific local ports, and then enter 137, 138 in the Specific local ports box.
Click Next.
On the Action page, select Allow the Connection, and then click Next.
On the Profile page, select the same profiles that you selected in step 3.
Click Next.
On the Name page, type a name in the name box, such as Remote Debugging File and Printer Sharing UDP.
Click Finish.
Close the Windows Firewall with Advanced Security window.
See Also
Tasks
How to: Set Up Remote Debugging
Change History
Date |
History |
Reason |
---|---|---|
October 2010 |
Updated procedures to show correct steps for Windows Vista. |
Customer feedback. |