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
The MySQL query result row field splicing can be ...
Table of contents 1. Props parent component ---&g...
Scenario: When page A opens page B, after operati...
If you upgrade in a formal environment, please ba...
This article mainly introduces the principle and ...
I had been working on the project before the New ...
Since 2019, both Android and IOS platforms have s...
Table of contents How to operate Operation proces...
Start the centos8 virtual machine and press the u...
CentOS official website address https://www.cento...
Table of contents The origin of JSBridge The bidi...
Overview The framework diagram of this article is...
Part of the code: Copy code The code is as follow...
Table of contents 1. Use slots to make components...
This article example shares the specific code of ...