This article is a mirror article of machine translation, please click here to jump to the original article.

View: 21677|Reply: 0

[Source] WeChat official account development VS remote debugging

[Copy link]
Posted on 1/4/2017 1:09:44 PM | | | |
The working principle of the WeChat public platform message interface can be roughly understood as follows: the user sends a message to the WeChat server, and the WeChat server will post the received message to the URL filled in when the user accesses. The principle is easy to understand, and it is easier to understand if you have been exposed to sockets.

In fact, WeChat development is not very troublesome or difficult, the official documents are also passable (at least hundreds of times better than WeChat payment documents), the most painful thing is debugging, because in the process of WeChat development, the user receives the message sent by WeChat The processing program is a server for WeChat, debugging is very painful, we can't interrupt the point, we can only use text files to see the operation of the program. I don't know if there are any friends like me at the beginning: deploy the code to the external network server, then send a message to the official account, then look at the debugging file, find the place that needs to be modified, then modify the code, and then upload the dll to the server ............, such an operation is too time-wasting and inefficient.
So this article is an introduction to vs. remote debugging

IIS configuration
Step 1 Configure IIS
Go to IIS, click URL, select your website, and click Binding in the edit website on the right side of the window, as shown in the image.
Enter the website binding window, edit or add bindings, the IP can be unselected, and the hostname writes the domain name of your peanut shell, as shown in the figure:
After filling in the information, click OK to complete the IIS configuration.

VS configuration
Step 2 VS Configuration
Open your project, select your web project, right-click, and select Properties.
Go to the web, in the server column, remove the use of IIS Express(X) option, fill in the domain name in the binding IIS in the project url, that is, the domain name given by Peanutshell, remember to add http://, as shown in the figure:
After the configuration is completed, press Ctrl+S to save, vs the configuration is temporarily completed.

Remotely debug configurations
Step 3 Remote debugger configuration
My environment is win7+vs2012, and the configuration process may be a little different, but I personally think it's similar.
First, find the Visual Studio Tool as shown in the picture:
After opening, find the Remote Debugger Folder shortcut and open it, select x86 or x64 according to your system, and double-click to open it.
Find the msvsmon.exe, right-click on it, and run it as administrator. After running, as shown in the figure:
Select Tools, Options, select No Authentication, and check Run Any User for Debugging, click OK
The debugger configuration is complete.

Start debugging
Step 4 Start debugging
In VS, select Debug, Attach to Process
In the Transmission column, select "Remote (No Authentication)", enter your local IP or hostname, and click Refresh in the lower right corner.
After clicking Refresh, in the Available Processes column, find w3wp.exe process, pay attention to the username column, see the application pool of the website you want to debug, if you don't find w3wp.exe, please go to IIS, open your website, and then click Refresh to find it.
Once you find this process, double-click to bring up a nearby safety warning and select Attach.
Remote commissioning is already possible. Let's take a quick look at the example.
Go to the WeChat public platform, enter the developer center, find the server configuration, and click Modify configuration.

The end result
After entering your URL and token, click the submit button, and the exciting time has come to smoothly enter the debug mode ~~~~~
Do you think it looks very high-end? Anyway, I think it's very high-end. Ha ha~~~~





Previous:MQTT APOLLO server setup
Next:c# M2Mqtt Connection to Apollo MQTT Server [with Source Code]
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com