I have mentioned the use of ASP in my article. one disadvantage of the NET unit test is that it cannot be debugged. Today I overturn my own incorrect argument, in fact, in ASP.. NET unit testing can also be debugged.
In the past, I thought ASP. NET unit testing would run on the WEB server, so I used Debug to run it. Then ASP. NET unit testing would automatically Attach to the Web server and Debug it. However, if ASP. NET unit testing can be debugged, the correct method should be:
1. In Web. config, locate the <compilation debug = "false"/> node and change the debug attribute to true.
2. Add the phrase "System. Diagnostics. Debugger. Break ()" at the beginning of the ASP. NET unit test code ()"
3. Run the ASP. NET unit test.
When you run the unit test, a prompt box is displayed, indicating whether the program encounters a breakpoint and whether to debug the program. Of course, debugging is selected.
After selecting the Debug program, there will be a second prompt box. Let's select the program to Debug and select a suitable VSTS,
After selecting a VSTS instance, the program will stop in the System. Diagnostics. Debugger. Break () statement,
At this time, press F5 to continue running the program. When the program encounters the next breakpoint, it will stop. From then on, you can debug the ASP. NET unit test.
- XML data displayed on the ASP. NET page
- What is iframe asp. NET?
- ASP. NET lifecycle display
- Solve the Problem of ASP. net ajax script errors
- ASP. NET Applications