The so-called dynamic debugging (trace) refers to let the program step by step execution, program running state concern us anytime, anywhere. Interrupt means is to let the program do not rush to execute down, and so I look over, and then went running to give you instructions. Breakpoint What is the point of interruption chant, is to run the program at this time, to break down, stopped Let me see :)
1. To use vs to debug, first let enable server-side debugging, is to set it in iis on the line, iis7 set as illustrated (iis7 not only the site that you want to set, also set to take effect in IE that):
2. in IE's Internet options -> settings -> advanced debugging is disabled (canceled tick) -> show Friendly Http error Messages (tick canceled)
3. in the place you want to debug, insert stop statement:
4. page ie access will pop up dialog box, select vs2005 or vs2010 as a debugger, all right, and click "Yes" (VS2010 exit point when seemingly there is a problem)
After that, there will be additional security warning, it does not matter, you can choose to attach to this process, that is, click "add." It will come out debugging interface:
Attention four places:
The top debug toolbar, command buttons that have to track debugging.
The leftmost column of the yellow arrow and the gray, yellow arrow tells us now to run to that step.
The right Solution Explorer is loaded asp iis server files.
The bottom bar some tips or helpful, such as the call stack, local variables, monitoring and so on.
Now combine debugging instance, one by one interpretation for everyone.
Click the green triangle allow the program to continue, if there is a breakpoint back (behind describes how to set breakpoints) will interrupt or stop it, otherwise the server asp in the footsteps finished, you can see the results on the page. The third blue box button, refers to the end of commissioning, even if there is a breakpoint will not be interrupted. The yellow arrow is used to display the current interrupt position, we could look at the code on other pages, forget where the current program running, click on the yellow arrow can immediately go running point (yellow arrow position indicates that the statement has not been executed ).
For example, the server is ready to perform Easp.Use "tpl" This statement, if I press f10, then the yellow arrow to move to the next statement: Easp.Tpl.Load "test.html". If f11 are tracked by Easp.Use to this function, as shown below:
For Use our little doubt, do not want to Use function inside tracked step by step, you can press shift + f11 (click on the toolbar button is also OK J) will jump Use function, the program will be in Easp.Tpl.Load "test.html "interrupted at the statement.
In this case represents Easp.W Easp.Tpl.GetHtml set a breakpoint, when the program will stop here to run down.
Just generally tell you how to use the stop statement to activate vs debug, then, how to set a breakpoint in the debugging process, and step by step tracking, if the tracking function, and how quickly jumped out from the function . However, we debugging purpose is to find out the bug, the key point is to see the value of a variable, then we take a look at a static debugging, write a bunch of stuff to see, but not at the cost of dynamic debugging Chuihuizhili can get.
all current variables can see, and the type of value of the variable, the variable is also clear. Click the plus sign corresponds to an object variable can expand to view a lot of information.
Oh, do not write any statement you can see: When visiting the page, there is a get argument, "id = 123", see the session ah, application ah very convenient, their own definition of the variable is not to say, of course, if the program is not to run at variable assignment, there would be nothing oh. Even the record set view is also very convenient.
Oh, in fact, do not worry, click on the "watch" in the Name column, enter the variable name you want to know, and then press Enter, you can! And in the inside of the input dynamic calculation no problem!
Such debugging is not more convenient than a trace of some? To test the value of the variable not to write a bunch of code, but look at the program logic appears n times feel when error-free, just do not know what the variable is in error, with dynamic tracking very simple. There are many more features, not introduced, we studied the results of contribution remember Oh!
Hee hee, in fact, can use VS to write asp website, so writing and debugging is fully integrated with the debugger stop do not have to write :), but also integrated vs vss, svn source code management tools, such as the development team also very convenient. All in all, a lot of advantages vs to write ah (hey, Microsoft's IDE is too toxic!), Just not the kind of DW on intelligence tips Easp (but prompted vbscript), but after writing that a few cooked Easp function also can not remember?
Reproduced in: https: //my.oschina.net/iwuyang/blog/198631