이 문서에서는 Visual Studio 원격 디버거를 Windows를 실행하는 Compute Engine 가상 머신의 프로세스에 연결하는 방법을 설명합니다.
기본 요건
시작하기 전에 가상 머신이 다음 기본 요건을 충족하는지 확인하세요.
Windows 운영체제를 실행합니다.
공개 IP 주소가 있습니다.
원격 PowerShell이 설치되고 사용 설정되어 있습니다.
원격 PowerShell 연결을 사용 설정하기를 원하지 않거나 원격 PowerShell이 VM에 설치되어 있지 않은 경우, MSDN Visual Studio 원격 디버깅을 검색하면 Visual Studio 디버거 원격 도구를 수동으로 설치하는 단계를 확인할 수 있습니다.
Tools(도구) > Google Cloud Tools(Google Cloud 도구) > Show Google Cloud Explorer(Google Cloud Explorer 표시)를 선택하여 Cloud Explorer를 실행합니다.
원격 디버거를 연결할 Compute Engine VM 인스턴스를 마우스 오른쪽 버튼으로 클릭하고 Attach debugger(디버거 연결)를 선택합니다.
연결 디버거 마법사가 표시됩니다.
필요한 포트로 트래픽을 허용하는 방화벽 규칙을 추가할지 묻는 메시지가 나타나면 OK(확인)를 클릭합니다.
대화상자의 자세히 알아보기 링크를 클릭하여 자세한 정보를 제공하는 방화벽 포트 열기 섹션으로 이동합니다.
디버깅할 프로세스를 선택하고 OK(확인)를 클릭합니다.
다음에 유의하세요.
원격 VM 인스턴스에 처음 연결할 때 마법사는 Visual Studio 원격 디버거 도구를 설치합니다. VM이 다른 지역에 있으면 이 설치에 다소 시간이 걸릴 수 있습니다.
디버거 도구는 대상 머신의 Program Files\VisualStudioRemoteTools에 설치됩니다.
출시 빌드를 최적화하려면 기호를 수동으로 로드해야 합니다.
애플리케이션을 디버깅할 때 Debug(디버그) > Windows > Modules(모듈)를 선택합니다.
디버깅 대상 어셈블리를 찾습니다.
적절한 항목을 마우스 오른쪽 버튼으로 클릭하고 Load Symbols(기호 로드)를 선택합니다.
방화벽 포트 열기
원격 디버깅을 사용하려면 대상 머신으로 가는 트래픽을 허용하고 Remote Debugging Tools에 연결할 수 있는 방화벽 규칙을 추가해야 합니다. Visual Studio 2017의 경우 포트는 4022입니다.
Visual Studio용 Cloud Tools는 원격 PowerShell 연결을 사용하는 원격 도구를 설치하고 시작할 수 있습니다. 먼저 원격 PowerShell HTTP 포트 5986을 사용 설정해야 합니다.
디버깅이 완료되면 방화벽 규칙을 제거하세요.
Tools(도구) > Google Cloud Tools(Google Cloud 도구) > Show Google Cloud Explorer(Google Cloud Explorer 표시)를 선택하여 Cloud Explorer를 실행합니다.
Compute Engine VM 인스턴스를 마우스 오른쪽 버튼으로 클릭하고 Firewall Options...(방화벽 옵션…)를 선택합니다.
Allow Visual Studio Debugger connections to the instance(인스턴스에 대한 Visual Studio 디버거 연결 허용) 및 Allow Remote PowerShell HTTPs traffic to the instance(인스턴스에 대한 원격 PowerShell HTTP 트래픽 허용) 방화벽 규칙의 체크박스를 선택 취소합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[],[],null,["# Attaching the remote debugger\n\n| **Beta**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThis document describes how to attach the Visual Studio remote debugger to\nprocesses on a Compute Engine Virtual Machine running Windows.\n\nPrerequisites\n-------------\n\nBefore you begin, ensure your virtual machine meets the following prerequisites:\n\n- Running the Windows operating system\n\n- Has a public IP address\n\n- Has Remote PowerShell installed and enabled\n\n - If you don't want to enable Remote PowerShell connection, or if it's not\n installed on the VM, you can find steps to install the Visual Studio\n Debugger Remote Tools manually by searching for **MSDN Visual Studio\n Remote Debugging**.\n\n - You can also [add firewall rules](/compute/docs/vpc/using-firewalls)\n to unblock the Debugger Remote Tool port.\n\nYou can [deploy an ASP.NET framework image](https://console.cloud.google.com/marketplace/details/click-to-deploy-images/aspnet?_ga=1.196962543.236660576.1482928062)\nthat meets all of these prerequisites.\n\nAttaching the remote debugger\n-----------------------------\n\nTo attach the remote debugger:\n\n1. Select **Tools** \\\u003e **Google Cloud Tools** \\\u003e **Show Google Cloud Explorer** to\n launch the **Cloud Explorer**.\n\n2. Right click the Compute Engine VM instance you want to attach the\n remote debugger to and select **Attach debugger**.\n\n The attach debugger wizard displays.\n3. Click **OK** when prompted to add firewall rules to allow traffic to the\n required ports.\n\n 1. The **Learn more** link in the dialog takes you to the [Opening firewall ports](#open_firewall_port) section for more information.\n4. Select the process to debug and click **OK**.\n\nNote the following:\n\n- The first time you connect to a remote VM instance, the wizard installs Visual\n Studio Debugger Remote Tools for you. This installation can take some time if\n the VM is in a different region.\n\n- The debugger tools are installed in `Program Files\\VisualStudioRemoteTools` on\n the target machine.\n\n- You must load symbols manually if you optimize your release build:\n\n 1. As you are debugging your application, select **Debug** \\\u003e **Windows** \\\u003e\n **Modules**.\n\n 2. Locate your debuggee assembly.\n\n 3. Right click the appropriate entry and select **Load Symbols**.\n\n### Opening firewall ports\n\nTo enable remote debugging, you need to add firewall rules to allow traffic to\nthe target machine and enable connection to the Debugging Remote Tools. For\nVisual Studio 2017, the port is **4022**.\n\nCloud Tools for Visual Studio can install and start remote tools for you using a\nremote PowerShell connection. You first must enable remote PowerShell HTTPs port\n**5986**.\n\nWhen you are finished debugging, remove the firewall rules:\n\n1. Select **Tools** \\\u003e **Google Cloud Tools** \\\u003e **Show Google Cloud Explorer** to\n launch the **Cloud Explorer**.\n\n2. Right click the Compute Engine VM instance and select\n **Firewall Options...**.\n\n3. Clear the checkboxes for the **Allow Visual Studio Debugger connections to\n the instance** and the **Allow Remote PowerShell HTTPs traffic to the\n instance** firewall rules.\n\n4. Click **Save** to remove the firewall rules."]]