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

Detailed example of concatenating multiple fields in mysql

The MySQL query result row field splicing can be ...

Eight examples of how Vue implements component communication

Table of contents 1. Props parent component ---&g...

How to use js to communicate between two html windows

Scenario: When page A opens page B, after operati...

Tutorial on upgrading from Centos7 to Centos8 (with pictures and text)

If you upgrade in a formal environment, please ba...

Analysis of the principle and creation method of Mysql temporary table

This article mainly introduces the principle and ...

win2008 server security settings deployment document (recommended)

I had been working on the project before the New ...

Html page supports dark mode implementation

Since 2019, both Android and IOS platforms have s...

MySQL partitions existing tables in the data table

Table of contents How to operate Operation proces...

How to quickly modify the root password under CentOS8

Start the centos8 virtual machine and press the u...

Detailed tutorial on installing centos8 on VMware

CentOS official website address https://www.cento...

A Preliminary Study on JSBridge in Javascript

Table of contents The origin of JSBridge The bidi...

How to clear floating example code in css

Overview The framework diagram of this article is...

10 Best Practices for Building and Maintaining Large-Scale Vue.js Projects

Table of contents 1. Use slots to make components...

js implements form validation function

This article example shares the specific code of ...