How to use the VS2022 remote debugging tool

How to use the VS2022 remote debugging tool

Sometimes you need to debug remotely in a server environment at work, such as when debugging WeChat related services.

1. Download the remote debugging tool

Website: https://visualstudio.microsoft.com/zh-hans/downloads/

After downloading, install directly to completion.

Start Remote Debugger:

If you are just testing for a short time, you can choose no authentication. For security reasons, the tool automatically sets an idle time, which means that the function will be automatically turned off after no operation.

2. Create a new test project

I built a simple HelloWorld project with a few lines of code and breakpoints.

Publish debug to remote server.

Double-click HelloWorld.exe to run the program

3. Start debugging

Click the menu [Debug] -> [Attach to Process] to open the following page

① Select the connection type

If authentication is enabled, leave it as default, otherwise select [No Authentication].

② Fill in the server IP and debugging service port

After filling in the form, press Enter directly and do not click the [Search] button at the back. The server-side processes are listed in the available processes.

③Screening process

Optional. If there are many server-side processes, you can filter them here. Fuzzy query is supported.

Find HelloWorld.exe and double-click to modify the process or click the Attach button, which is the same as attaching a local process.

Enter any character and press Enter to see that you have entered the breakpoint.

Debugging can now be performed normally.

4. Debugging a website in IIS

If you are debugging a website published to IIS, the process you need to attach is w3wp.exe.

You may encounter the following situations:

If you cannot see the process, you need to consider the following operations: ① Visit the website. Sometimes the process cannot be found in hibernation mode. ② Check "Show processes from all users" and refresh.

If you see multiple w3wp.exe, this means that multiple websites are deployed in IIS and you don’t know which one to attach to. You can run cmd with administrator privileges and execute the following command:

cd %windir%\system32\inetsrv
appcmd list wp

In the execution results, you can see the name of the website and the corresponding process ID. When attaching a process, you can distinguish it based on the process ID.

This concludes this article on how to use the VS2022 remote debugging tool. I hope it will be helpful for everyone’s study, and I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • C# code debugging tips and how to debug remotely
  • Detailed steps for VSCode to build an Arm remote debugging environment
  • Teach you how to use VS remote debugging

<<:  HTML optimization techniques you must know

>>:  Node.js adds, deletes, modifies and checks the actual combat record of MySQL database

Recommend

MySQL stored procedure method example of returning multiple values

This article uses an example to describe how to r...

Analyzing the node event loop and message queue

Table of contents What is async? Why do we need a...

Detailed explanation of scp and sftp commands under Linux

Table of contents Preface 1. scp usage 2. Use sft...

How to build and deploy Node project with Docker

Table of contents What is Docker Client-side Dock...

JavaScript to implement login form

This article example shares the specific code of ...

Native JS to implement breathing carousel

Today I will share with you a breathing carousel ...

Ubuntu starts the SSH service remote login operation

ssh-secure shell, provides secure remote login. W...

MySQL query data by hour, fill in 0 if there is no data

Demand background A statistical interface, the fr...

Summary of practical experience of HTML knowledge points

1. The table tag is table, tr is row, td is cell, ...

Detailed explanation of process management in Linux system

Table of contents 1. The concept of process and t...

Detailed tutorial on installing MySQL database in Linux environment

1. Install the database 1) yum -y install mysql-s...

Install multiple versions of PHP for Nginx on Linux

When we install and configure the server LNPM env...

Vue Beginner's Guide: Environment Building and Getting Started

Table of contents Initial Vue Building a Vue deve...