Sometimes you need to debug remotely in a server environment at work, such as when debugging WeChat related services. 1. Download the remote debugging toolWebsite: 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 projectI 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 debuggingClick the menu [Debug] -> [Attach to Process] to open the following page ① Select the connection typeIf authentication is enabled, leave it as default, otherwise select [No Authentication]. ② Fill in the server IP and debugging service portAfter 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 processOptional. 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 IISIf 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:
|
<<: HTML optimization techniques you must know
>>: Node.js adds, deletes, modifies and checks the actual combat record of MySQL database
This article uses an example to describe how to r...
Table of contents What is async? Why do we need a...
Table of contents Preface 1. scp usage 2. Use sft...
Table of contents What is Docker Client-side Dock...
This article example shares the specific code of ...
Today I will share with you a breathing carousel ...
Uses of new The function of new is to create an i...
When using MySQL, dates are generally stored in f...
ssh-secure shell, provides secure remote login. W...
Demand background A statistical interface, the fr...
1. The table tag is table, tr is row, td is cell, ...
Table of contents 1. The concept of process and t...
1. Install the database 1) yum -y install mysql-s...
When we install and configure the server LNPM env...
Table of contents Initial Vue Building a Vue deve...