Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
En este documento, se describe cómo adjuntar el depurador remoto de Visual Studio a los procesos en una máquina virtual de Compute Engine que ejecuta Windows.
Requisitos previos
Antes de comenzar, asegúrate de que tu máquina virtual cumpla con los siguientes requisitos previos:
Ejecuta el sistema operativo Windows
Tiene una dirección IP pública
Tiene PowerShell remoto instalado y habilitado
Si no deseas habilitar la conexión de PowerShell remoto o si no está instalada en la VM, puedes encontrar los pasos para instalar las herramientas remotas del depurador de Visual Studio manualmente si buscas Depuración remota de Visual Studio de MSDN.
También puedes agregar reglas de firewall para desbloquear el puerto de la herramienta remota del depurador.
Sigue los pasos a continuación para adjuntar el depurador remoto:
Selecciona Herramientas > Herramientas de Google Cloud > Mostrar Google Cloud Explorer para iniciar Cloud Explorer.
Haz clic derecho en la instancia de VM de Compute Engine a la que deseas adjuntar el depurador remoto y selecciona Adjuntar depurador.
Aparecerá el asistente para adjuntar el depurador.
Haz clic en Aceptar cuando se te solicite agregar reglas de firewall para permitir el tráfico a los puertos requeridos.
El vínculo Más información en el cuadro de diálogo te lleva a la sección Apertura de puertos firewall para obtener más información.
Selecciona el proceso a depurar y haz clic en Aceptar.
Ten en cuenta lo siguiente:
La primera vez que te conectas a una instancia de VM remota, el asistente instala las herramientas remotas del depurador de Visual Studio por ti. Esta instalación puede llevar algún tiempo si la VM está en una región diferente.
Las herramientas del depurador se instalan en Program Files\VisualStudioRemoteTools en la máquina de destino.
Debes cargar los símbolos manualmente si optimizas tu compilación de la versión:
Cuando estés depurando tu aplicación, selecciona Depurar > Windows > Módulos.
Localiza tu conjunto de depuración.
Haz clic derecho en la entrada correspondiente y selecciona Cargar símbolos.
Abre los puertos de firewall
Para habilitar la depuración remota, debes agregar reglas de firewall a fin de permitir el tráfico a la máquina de destino y habilitar la conexión a las herramientas remotas de depuración. Para Visual Studio 2017, el puerto es 4022.
Cloud Tools for Visual Studio puede instalar y también iniciar herramientas remotas mediante una conexión de PowerShell remota. Primero debes habilitar el puerto HTTP 5986 de PowerShell.
Cuando hayas terminado la depuración, quita las reglas de firewall:
Selecciona Herramientas > Herramientas de Google Cloud > Mostrar Google Cloud Explorer para iniciar Cloud Explorer.
Haz clic derecho en la instancia de VM de Compute Engine y selecciona Opciones de firewall…
Desmarca las casillas de verificación para permitir conexiones del depurador de Visual Studio a la instancia y permitir el tráfico de HTTP de PowerShell a las reglas de firewall de la instancia.
Haz clic en Guardar para quitar las reglas de firewall.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 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."]]