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

View: 46830|Reply: 1

[Source] Debug IIS pages by attaching processes in VS, and solve the problem of setting breakpoints that are invalid

[Copy link]
Posted on 8/18/2016 2:50:23 PM | | | |

In the past, when debugging a website, it was customary to right-click directly in the solution - start a new instance, but later found that such disadvantages were:
1. The start is relatively slow;
2. The request parameter of some browsers cannot be imported;
3. If you do not specify the startup URL, VS will load the page to localhost, such as http://localhost/test.aspx;
      In this case, cookies shared through domain names cannot be shared.
On the hard side, I decided to debug IIS pages by attaching a process in VS.
The steps are as follows:
1. Create a site in IIS and directly point to the folder where the program is located (or the path points to the folder where the program is published);
2. Set a breakpoint on the page to be tested, then select "Debug" > "Attach to Process", and select w3wp.exe process in the process (you need to open the CRM or the page to be tested first); If you can't find w3wp.exe process, there is a show processes in all sessions at the bottom of the process list, and you can see it
3. But I found that I couldn't enter the breakpoint, referring to everyone's instructions, whether the generation method was debug and so on did not solve my problem.
Finally, I found that it was the property page debugger of the web project - the native code was not checked, and the page can be successfully debugged, so happy!
4. In addition, it is best to check the enable editing of the above picture and continue to tick it, otherwise it may be reported as an error and cannot be accessed






Previous:.NET Memcached and .NET client calls
Next:WebAPI receives Chinese garbled characters
 Landlord| Posted on 3/2/2021 9:59:42 AM |
Wait for the attachment to the process before executing the 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