Analysis of ASP. NET Unit Testing

Source: Internet
Author: User

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.

  1. XML data displayed on the ASP. NET page
  2. What is iframe asp. NET?
  3. ASP. NET lifecycle display
  4. Solve the Problem of ASP. net ajax script errors
  5. ASP. NET Applications

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.