Aracılığıyla paylaş


How to: Manually Configure the Windows 7 Firewall for Remote Debugging

This topic applies to:

Edition

Visual Basic

C#

F#

C++

Web Developer

Express

Topic does not apply Topic does not apply Topic does not apply Topic does not apply Topic does not apply

Pro, Premium, and Ultimate

Topic applies Topic applies Topic applies Topic applies Topic applies

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 turned off, no firewall configuration is necessary.

If the Windows Firewall is turned 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.

Uyarı

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 manually configure the Visual Studio host computer

  1. In Control Panel,click System and Security.

  2. Click Windows Firewall.

  3. Add an exception for TCP 135, which is the port that is used by DCOM to communicate with the remote computer.

    1. In the Windows Firewall control panel, click Advanced Settings.

    2. If the User Account Control dialog box appears, click Yes to continue.

      The Windows Firewall with Advanced Security window opens.

    3. Click Inbound Rules.

    4. In the Actions pane, click New Rule.

      The New Inbound Rule Wizard appears.

    5. Under What type of rule would you like to create?, select Port, then click Next.

    6. Select TCP and Specific local ports, then enter 135 in the Specific local ports box.

    7. Click Next.

    8. On the Action page, select Allow the Connection, then click Next.

    9. 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.

    10. Click Next.

    11. On the Name page, type a meaningful name, such as Remote Debugging DCOM, in the name box.

    12. Click Finish.

  4. If your domain policy requires network communication to take place through IPSec, perform this step. Otherwise, go to step 5.

    1. Click New Rule.

      The New Inbound Rule Wizard appears.

    2. Under What type of rule would you like to create?, select Port, then click Next.

    3. Select UDP and Specific local ports, then enter 4500 and 500 in the Specific local ports box.

    4. Click Next.

    5. On the Action page, select Allow the Connection, then click Next.

    6. On the Profile page, select the same profiles that you selected in step 3.

    7. Click Next.

    8. On the Name page, type a name, such as Remote Debugging DCOM UDP, in the name box.

    9. Click Finish.

  5. Close the Windows Firewall with Advanced Security window.

  6. In the Windows Firewall control panel, add an exception for the Visual Studio devenv.exe process.

    1. Click Allow a program or feature through Windows Firewall.

    2. Click Change Settings.

    3. Click Allow another program.

    4. In the Add a program dialog box, click Browse.

    5. In the Browse dialog box, navigate to the devenv.exe location. The location is usually SystemDrive:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE.

    6. Click OK to close the Browse dialog box.

    7. Click OK to close the Add a program dialog box.

To manually configure the remote computer

  1. In Control Panel,click System and Security.

  2. Click Windows Firewall.

  3. Add an exception for TCP 135, which is the port that is used by DCOM to communicate with the remote computer.

    1. In the Windows Firewall control panel, click Advanced Settings.

    2. If the User Account Control dialog box appears, click Yes to continue.

      The Windows Firewall with Advanced Security window opens.

    3. Click Inbound Rules.

    4. In the Actions pane, click New Rule.

      The New Inbound Rule Wizard appears.

    5. Under What type of rule would you like to create?, select Port, then click Next.

    6. Select TCP and Specific local ports, then enter 135 in the Specific local ports box.

    7. Click Next.

    8. On the Action page, select Allow the Connection, then click Next.

    9. 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.

    10. Click Next.

    11. On the Name page, type a meaningful name, such as Remote Debugging DCOM, in the name box.

    12. Click Finish.

  4. If your domain policy requires network communication to take place through IPSec, perform this step. Otherwise, go to step 5.

    1. Click New Rule.

      The New Inbound Rule Wizard appears.

    2. Under What type of rule would you like to create?, select Port, then click Next.

    3. Select UDP and Specific local ports, then enter 4500 and 500 in the Specific local ports box.

    4. Click Next.

    5. On the Action page, select Allow the Connection, then click Next.

    6. On the Profile page, select the same profiles that you selected in step 3.

    7. Click Next.

    8. On the Name page, type a name, such as Remote Debugging DCOM UDP, in the name box.

    9. Click Finish.

  5. 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.

    1. Click New Rule.

      The New Inbound Rule Wizard appears.

    2. Under What type of rule would you like to create?, select Port, then click Next.

    3. Select TCP and Specific local ports, then enter 139, 445 in the Specific local ports box.

    4. Click Next.

    5. On the Action page, select Allow the Connection, then click Next.

    6. On the Profile page, select the same profiles that you selected in step 3.

    7. Click Next.

    8. On the Name page, type a name, such as Remote Debugging File and Printer Sharing TCP, in the name box.

    9. Click Finish.

    10. Click New Rule again.

      The New Inbound Rule Wizard appears.

    11. Under What type of rule would you like to create?, select Port, then click Next.

    12. Select UDP and Specific local ports, then enter 137, 138 in the Specific local ports box.

    13. Click Next.

    14. On the Action page, select Allow the Connection, then click Next.

    15. On the Profile page, select the same profiles that you selected in step 3.

    16. Click Next.

    17. On the Name page, type a name, such as Remote Debugging File and Printer Sharing UDP, in the name box.

    18. Click Finish.

  6. Close the Windows Firewall with Advanced Security window.

  7. In the Windows Firewall control panel, add an exception for the Visual Studio msvcmon.exe process.

    1. Click Allow a program or feature through Windows Firewall.

    2. Click Change Settings.

    3. Click Allow another program.

    4. In the Add a program dialog box, click Browse.

    5. In the Browse dialog box, navigate to the devenv.exe location. The location is usually SystemDrive:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE.

    6. Click OK to close the Browse dialog box.

    7. Click OK to close the Add a program dialog box.

See Also

Tasks

How to: Set Up Remote Debugging